这是场景
我正在以这种形式从服务器获取数据
$scope.data=[
{"name":"xyz","status":"pending"},
{"name":"abc","status":"completed"},
{"name":"pqr","status":"completed"}
]
此数据是针对不同状态的单独GET调用
$scope.statusValues=[
{"statusName":"pending","id":"1"},
{"statusName":"completed","id":"2"},
{"statusName":"cancelled","id":"3"},
{"statusName":"custom","id":"4"}
]
在HTML中:-
<div ng-repeat="t in data">{{t.name}}</div>
如何在具有更多$ scope.statusValues的Select方法中显示t.status值
最佳答案
使用键值对组合它们。
I have created plunker it may helpful.
Plunker