ng-repeat 指令

<!--索引属性:$index,$first,$middle,$last-->
<!--样式属性:ng-class-even,ng-class-odd-->
<tr ng-repeat="user in users" ng-class-even="'light-gray'" ng-class-odd="'dark-gray'">
    ...
</tr>
等价于
<tr ng-repeat="user in users" ng-class="{'dark-gray':!$index%2,'light-gray':$index%2}">
    ...
</tr>
<!--迭代相邻元素技巧:ng-repeat-start-->
<ul>
    <li ng-repeat-start="item in testData">
        <strong>{{item.a}}</strong>
    </li>
    <li>---------------</li>
    <li ng-repeat-end>{{item.desc}}</li>
</ul>

 

posted @ 2015-05-27 16:52  流失的痕迹  阅读(827)  评论(0编辑  收藏  举报