好吧,我有一个奇怪的问题。我有一个对象数组。每个对象都包含另一个(字符串)数组。我使用遍历对象数组ng-repeat
。在重复的代码中,我ng-repeat
遍历了字符串数组。由于某些原因,ng-repeat
仅当字符串数组仅包含一(1)个项目时,此嵌套功能才起作用。当有更多项目时,它根本不起作用。
代码
的结果 <pre>{{ answer.value | json }}</pre>
[
"Apothekerskast",
"Apothekerskast",
"Koelkast ombouw"
]
该view
(一个要点,因为此留言出现问题的原因降价):https://gist.github.com/fabdrol/898e4ac9760fc358ce81
数据(JSON),以便于阅读:https : //gist.github.com/fabdrol/089467fa09dad6e89e81
它不喜欢重复,使用track by $index
:
ng-repeat="val in vals track by $index"
JSFiddle:http : //jsfiddle.net/nedq13q2/
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句