【发布时间】:2015-12-16 20:16:05
【问题描述】:
我的控制器中有两个商店:
$scope.categoryStore = [{id: 1, label: "A"}, {id: 2, label: "B"}, {id: 3, label: "C"}];
$scope.collectionStore = [{id: 1, categoryId: 1, name: "Test"}, {id: 1, categoryId: 2, name: "Test2"}];
在我看来,我对 collectionStore 有一个 ng-repeat。现在我想显示 categoryStore 的标签而不是 categoryId。
<tr ng-repeat="item in collectionStore">
<td>{{item.id}}</td>
<td>{{item.categoryid}} <!-- this would be the label --></td>
<td>{{item.name}}</td>
</tr>
【问题讨论】: