第一次练习就直接没效果:

 

"后不能直接以 function XXXcontroller (){ code......}这样的方式直接注册监听器了。

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

 

以下是标准的:

  1. <script type="text/javascript">
  2.         angular.module('phonecatApp', []).controller('PhoneListCtrl', function ($scope) {
  3.             $scope.phones = [
  4.          {
  5.              "name": "Nexus S",
  6.              "snippet": "Fast just got faster with Nexus S."
  7.          },
  8.          {
  9.              "name": "Motorola XOOM? with Wi-Fi",
  10.              "snippet": "The Next, Next Generation tablet."
  11.          },
  12.          {
  13.              "name": "MOTOROLA XOOM?",
  14.              "snippet": "The Next, Next Generation tablet."
  15.          }
  16.             ];
  17.         });
  18.  
  19.     </script>

 

国内中文博客还不更新,情何以堪。。。。

另外,Angularjs文档被墙在外面了。。

 

参考:

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

相关文章:

  • 2022-12-23
  • 2021-07-05
  • 2021-08-10
  • 2021-11-07
  • 2021-11-13
  • 2022-01-06
  • 2021-11-13
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案