发表于: 2016-08-11 22:34:48
0 2305
今天完成的事情:看基础
明天计划的事情:继续
遇到的问题:。。
收获:
ng-repeat指令。遍历一个数据集合中的每个数据元素,并且加载HTML模版把数据渲染出来,当我们要向HTML容器节点中添加更多类似DOM元素的时候,使用ng-repeat是再好不过了。

也可以写为x in firends track by $index
track by主要是防止值有重复
也可以写为:
<tr ng-repeat = "x in friend">
<td ng-repeat = " y in x"></td>
</tr>
以及ng-repeat = "x in [1]",遍历一次
ng-repeat = "x in [1,2]",遍历两次
评论