0
我正在使用角度ui-选择来进行多重选择。无法使用角度ui-select对typeahead值进行多重选择
<label>All Users</label>
<ui-select multiple ng-model="a.users" close-on-select="false">
<ui-select-match placeholder="Select users">{{$item}}</ui-select-match>
<ui-select-choices typeahead="val for val in getAllUsers($viewValue)" typeahead-loading="loadingCodes" typeahead-no-results="noResults"></ui-select-choices>
</ui-select>
下拉列表中的数据来自API。
我的指令代码:
scope.getAllUsers = function(key) {
var obj = {
"key": key
}
function extract(resp) {
return resp.data.slice(0)
}
if (key.length >= 2) {
return Promise.all([
ApiServices.getPrimaryUsers(obj).then(extract),
ApiServices.getSecondaryUsers(obj).then(extract)
])
.then(function(results) {
return [].concat.apply([], results)
});
}
else {
return false;
}
}
但我它不是为我工作。我在下拉菜单中没有收到任何数据。无法多选两者。谁能帮我这个?
任何人请给我任何答案或建议 –