[英]ngRepeat cant iterate through nested array
I want to access each value of my array of arrays: 我想访问我的数组数组的每个值:
[
["0","0","0"],
["1","1","1"],
["1","0","0"]
]
I've done only two ngRepeat inside 我只做了两个ngRepeat
<ul>
<li ng-repeat="line in test">
{{line}}
<ul>
<li ng-repeat="point in line">
{{point}}
</li>
</ul>
</li>
</ul>
It's probably something stupid, but I can't figure out. 这可能是愚蠢的,但我不知道。
here is plunk: http://plnkr.co/edit/LeZw0HRab472dcNiHPQM?p=preview 这里很pl: http ://plnkr.co/edit/LeZw0HRab472dcNiHPQM? p =preview
What I think you are looking for is: 我认为您正在寻找的是:
<ul>
<li ng-repeat="line in test">
<ul>
<li ng-repeat="point in line track by $index">
{{point}}
</li>
</ul>
</li>
</ul>
http://plnkr.co/edit/72a1Brmn2eBuTWhI8pfC?p=preview http://plnkr.co/edit/72a1Brmn2eBuTWhI8pfC?p=preview
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.