Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays AngularJS:nested ng repeat(对象中的数组)仅在数组中有一个项目时有效,而在多个项目时无效_Arrays_Angularjs_Angularjs Ng Repeat - Fatal编程技术网

Arrays AngularJS:nested ng repeat(对象中的数组)仅在数组中有一个项目时有效,而在多个项目时无效

Arrays AngularJS:nested ng repeat(对象中的数组)仅在数组中有一个项目时有效,而在多个项目时无效,arrays,angularjs,angularjs-ng-repeat,Arrays,Angularjs,Angularjs Ng Repeat,好吧,我有个奇怪的问题。我有一个对象数组。每个对象包含另一个数组(字符串)。我使用ng repeat在对象数组上循环。在重复代码中,Ing在字符串数组上重复。出于某种原因,这种嵌套的ng repeat仅在字符串数组只包含一(1)项时有效。当有更多的项目时,它根本不起作用 代码 [ "Apothekerskast", "Apothekerskast", "Koelkast ombouw" ] 视图(在要点中,因为在此处发布会导致降价问题): 数据(JSON格式)为了便于阅读:使用t

好吧,我有个奇怪的问题。我有一个对象数组。每个对象包含另一个数组(字符串)。我使用
ng repeat
在对象数组上循环。在重复代码中,I
ng在字符串数组上重复
。出于某种原因,这种嵌套的
ng repeat
仅在字符串数组只包含一(1)项时有效。当有更多的项目时,它根本不起作用

代码


[
  "Apothekerskast",
  "Apothekerskast",
  "Koelkast ombouw"
]
视图
(在要点中,因为在此处发布会导致降价问题):

数据(JSON格式)为了便于阅读:

使用
track by$index

ng repeat=“val中的val按$index跟踪”


JSFiddle:

谢谢!你救了我一天。