我是AngularJs的新手。我想使用納克重複如對(I = 0;我< ele.length; I + = 2)AngularJs ng-repeat更改循環增量
我有4列,其中我將使用表NG-重複
<table>
<tr ng-repeat="i in elements">
<th>{{i.T}}</th>
<td>{{i.V}}</td>
<th>{{elements[($index+1)].T}}</th> <!-- This should be next element of the elements array -->
<td>{{elements[($index+1)].V}}</td> <!-- This should be next element of the elements array -->
</tr>
</table>
我需要在一次迭代訪問2個元素,迭代增量應該是2
我希望這是有道理的。請幫幫我。
請檢查這個網站觀點Plunker
你會好起來:
的jsfiddle? – 2013-02-27 13:10:02
@ArunPJohny,你的意思是重新排列數組的元素?我從API請求中獲取該數組,並將其用於許多其他地方。因此,修改ng-repeat時幾乎沒有問題 – Gihan 2013-02-27 13:22:51
解決方案是使用http://jsfiddle.net/gwfPh/ – 2013-02-27 13:24:48