学习angularjs时遇到 XX is not a function

学习angularjs时遇到 XX is not a function

  • |
  • 浏览:501
  • |
  • 更新:2015-04-23 15:51
  • 学习angularjs时遇到 XX is not a function 1
  • 学习angularjs时遇到 XX is not a function 2
  • 学习angularjs时遇到 XX is not a function 3
分步阅读

http://jingyan.baidu.com/article/eae07827ae12b91fec548597.html

当学习angularjs 遇到

Error: [ng:areq] Argument 'PhoneListCtrl' is not a function, got undefined

学习angularjs时遇到 XX is not a function 方法/步骤
  1. 出现这个问题是因为在 angularJs 1.3 中 为了让 根节点上(rootScope)不再被挂上许多冗余的内容,所以禁止了直接在根上注册controller。

  2. 第一:以后不能直接以  function XXXcontroller (){ code......}这样的方式直接注册监听器了。以后必须

    angular.module('phonecatApp', []).controller('PhoneListCtrl',function($scope) {}这样来将controller注册到对应的模型上。

  3. 第二:  在 ng-aap 中指定相对应的模型。

    如 之前:

    <html ng-app>(不指定则为根元素)

    现在:

    <html ng-app="phonecatApp">

    学习angularjs时遇到 XX is not a function
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值