ng-repeat 用了多个$index, 怎样定位不同的$index?

2014-12-12 11:04:41 +08:00
 AlanZhang
ng-repeat="certification in product.certifications track by $index"
ng-repeat="standards in certification.standards track by $index"

这两个$index都需要定位到。
9292 次点击
所在节点    Angular
3 条回复
L42y
2014-12-12 11:09:17 +08:00
用 `ngRepeat`: https://docs.angularjs.org/api/ng/directive/ngInit

The only appropriate use of ngInit is for aliasing special properties of ngRepeat
L42y
2014-12-12 11:09:50 +08:00
不好意思,应该是用 ngInit
AlanZhang
2014-12-12 11:13:54 +08:00
非常感谢。 就是这个。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/153356

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX