0
私は多重選択に角度ui-selectを使用しています。先読み値に角度ui-selectを使用して複数選択することができません
<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;
}
}
しかし、私はその私のために働いていません。ドロップダウンにデータが表示されません。複数選択することもできません。誰もこれで私を助けることができますか?
誰でも私に何か回答や提案を送ってください –