标签:country 技术 nbsp class angular try ini 使用 blog
使用ng-repeat 来循环数组
<div ng-app="" ng-init="names=[‘Jani‘,‘Hege‘,‘Kai‘]"> <ul> <li ng-repeat="x in names"> {{ x }} </li> </ul> </div>
<div ng-app="" ng-init="names=[ {name:‘Jani‘,country:‘Norway‘ }, {name:‘Hege‘,country:‘Sweden‘}, {name:‘Kai‘,country:‘Denmark‘} ];countrys=[ {name:‘1‘,country:‘a‘}, {name:‘2‘,country:‘b‘}, {name:‘3‘,country:‘c‘} ]"> <p>循环对象:</p> <ul> <li ng-repeat="x in names"> {{x.name + ‘,‘ + x.country}} </li> <li ng-repeat="y in countrys"> {{y.name + ‘,‘ + y.country}} </li> </ul> </div>
标签:country 技术 nbsp class angular try ini 使用 blog
原文地址:http://www.cnblogs.com/kailzhou/p/7027450.html