angular自己的笔记
2024-10-11 04:56:35
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
最新文章
- [JAVA] 注解学习@interface
- UnicodeEncodeError: &#39;ascii&#39; codec can&#39;t encode characters in position问题的解决办法
- Qt5.3编译错误——call of overloaded ‘max(int int)’is ambiguous
- 实现台式机redhat6.4无线网卡上网RTL8188CUS
- 【final】站立会议---11.27
- 读取XML文件的节点内的内容
- No connection string named &#39;***&#39; could be found in the application config file
- AndroidAsync :异步Socket,http(client+server),websocket和socket.io的Android类库
- php 命名空间(要求php5.3以上)
- Create XHR
- jQuery 遍历函数(八)
- 状态压缩动态规划 状压DP
- noj 算法 八数码问题
- Ubuntu 14.04 安装caffe
- Android开发专业名词及工具概述
- IIS 禁止回收
- day8:vcp考试
- ASP.NET Identity 修改表名和主键类型
- Windows Azure 系列-- Azure Queue的操作
- Ubuntu + apache + Mysql +php
热门文章
- IL查看override
- Android优化—— 内存分析工具 MAT 的使用
- variable &#39;xxx&#39; unsafe in &#39;case&#39;的处理
- C语言 三级指针的应用
- C语言 二级指针内存模型③
- [转]在 Eclipse 中嵌入 NASA World Wind Java SDK
- ROWNUMBER() OVER( PARTITION BY COL1 ORDER BY COL2)用法
- mysql5.7.12直接解压zip包,安装过程
- Ubuntu 14.04 下安装google的浏览器——Chrome
- 第一个WP8程序,照相机