angular自己的笔记

  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代码:

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

本文作者:方方和圆圆

本文链接:https://www.cnblogs.com/diligenceday/p/4167786.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   方方和圆圆  阅读(208)  评论(0编辑  收藏  举报
历史上的今天:
2013-12-16 nodeJS
2013-12-16 自己根据前些天热门的模版引擎文章,弄了一个模版引擎

再过一百年, 我会在哪里?

💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
点击右上角即可分享
微信分享提示