我想在json项目中使用ui select for array:
我在html中使用了ui
<div class="col-xs-12 col-sm-3 col-md-2 pad-left-right-0 filter">
<span>Labels</span>
<ui-select multiple ng-model="labels.selected" ng-change="refreshData()" theme="bootstrap">
<ui-select-match >{{$item.name}}</ui-select-match>
<ui-select-choices repeat="item in data | filter: $select.search">
<div ng-bind-html="item.labels | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
</div>
我在每个数组元素中包含json的数组
{data: [{
"developer": "dev",
"team": "MP",
"qa": "dev",
"pm": "dev",
"jTicket": {
"jId": "test",
"jUrl": "jurl",
"issueType": "Story",
"jSummary": "test"
},
"mr": {
"number": 25767,
"title": "test",
"url": "url",
"links": [],
"screenShotLinks": [
"url_here"
],
"testLinks": [],
"description": "",
"labels": ["label 2", "label 5", "label 8"]
}
}]}
我想在数据json中的每个项目中使用labels []填充ui select ui-select-choices。但没有标签被填充。
答案 0 :(得分:0)
您正在记录标签,因为标签键不在主节点上。它位于 mr 对象内。相反,你可以像这样使用它,
<div ng-bind-html="item.mr.labels | highlight: $select.search"></div>
希望它能解决你的问题。