【发布时间】:2018-02-10 00:24:11
【问题描述】:
我正在尝试在列表中显示一个列表。此循环在 JavaScript 中有效。
for ( i=0; self.InsuredCommoditiesList.length > i; i++){
self.CommoditiesCategories = self.InsuredCommoditiesList[i].Category;
for (j = 0; self.InsuredCommoditiesList[i].Items.length > j; j++) {
self.CommoditiesList = self.InsuredCommoditiesList[i].Items[j];
}
这是我的 ng-repeat 的主体
<label ng-repeat="commo in QQCtrl.InsuredCommoditiesList track by $index">
{{commo.Category}}
<input type="checkbox"> {{commo.Items}}
</label>
我的结果几乎是正确的,问题是 "Items" 没有单独显示。相反,它只是显示整个数组。
我可以在我的 ng-repeat 中使用类似于 position "j" 的东西来单独显示项目吗?
【问题讨论】:
标签: javascript angularjs for-loop angularjs-ng-repeat