码迷,mamicode.com
首页 > 其他好文 > 详细

angular自己的笔记

时间:2014-12-16 20:38:28      阅读:143      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   ar   io   color   sp   java   on   

  angular知道怎么用了, 就打算读一读源代码;

<html ng-app="phonecatApp">
    <head>
        <meta charset="utf-8" />
        <script src="http://cdn.bootcss.com/jquery/2.1.1-rc2/jquery.min.js"></script>
    <!--这个angular就是下面我贴出来的JS代码-->
<script type="text/javascript" src="angular_devolop.js"></script> </head> <body ng-controller="PhoneListCtrl" id="p"> <ul> <li ng-repeat="phone in phones" t={{txt}}> {{phone.name}} <p>{{phone.snippet}}</p> </li> </ul> </body> <script> //初始化用户模块; var phonecatApp = angular.module(phonecatApp, []); //为用户的控制器添加反射, 就是回调了, 文档加载完毕就会用到了; phonecatApp.controller(PhoneListCtrl, function($scope) { $scope.txt = "text"; $scope.phones = [ {name: Nexus S, snippet: Fast just got faster with Nexus S.}, {name: Motorola XOOM™ with Wi-Fi, snippet: The Next, Next Generation tablet.}, {name: MOTOROLA XOOM™, snippet: The Next, Next Generation tablet.} ]; }); </script> </html>

  JS代码:

  http://files.cnblogs.com/diligenceday/angular_devolop.js

angular自己的笔记

标签:style   blog   http   ar   io   color   sp   java   on   

原文地址:http://www.cnblogs.com/diligenceday/p/4167786.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!