标签:使用 io 数据 ar cti html htm ad
<html ng-app>
<head>
<script src="lib/angular/angular.js"></script>
<script>
function PhoneListCtrl($scope){
$scope.phones = [
{‘name‘:‘华为‘},
{‘name‘:‘中兴‘}
]
}
</script>
</head>
<body ng-controller="PhoneListCtrl">
<ul>
<li ng-repeat="phone in phones">
<p>{{phone.name}}</p>
</li>
</ul>
</body>
</html> ng-app 指定AngularJS作用域
ng-controller 指定Controller作用域
ng-repeat 循环迭代phones数组对象,赋值给phone,作用域内使用{{ }}占位实际值用于显示
$scope 为AngularJS依赖注入的自带对象,用于与页面数据的双向绑定
AngularJS 入门级(一) HelloWorld,布布扣,bubuko.com
标签:使用 io 数据 ar cti html htm ad
原文地址:http://my.oschina.net/sourcecoding/blog/299158