我需要一个嵌套ng-repeat循环的第二个$index。 我应该在哪里放置它?
AngularJS网站上说:
可以使用ngInit为这些属性创建别名,当嵌套ngRepeats时可能会有用。
<div ng-repeat="person in persons track by $index">
<div ng-repeat="something in array track by $index2"> <!-- where to init this and how to manage it?-->
如果我再次使用$index,似乎可以工作,但我不确定这是否正确?我相信有一种简单而正确的方法来做到这一点,只是我找不到例子。
谢谢