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>

 

你可能感兴趣的:(指令)