Angular ui-select 多个干净的 ng-model 值

Angular ui-select multiple clean ng-model value

我正在尝试使用 ui-select,该组件正在清理我的阵列。

示例:

{{ vm.staff_hotels }}
<ui-select multiple ng-model="x" theme="bootstrap">
    <ui-select-match placeholder="Not selected">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="hotel.id as hotel in vm.hotels | filter: {active: true} | filter: $select.search">
        <div ng-bind-html="hotel.name | highlight: $select.search"></div>
    </ui-select-choices>
</ui-select>

我的变量 "vm.staff_hotels" 在屏幕上的值为 [1,2]。

{{ vm.staff_hotels }}
<ui-select multiple ng-model="vm.staff_hotels" theme="bootstrap">
    <ui-select-match placeholder="Not selected">{{$item.name}}</ui-select-match>
    <ui-select-choices repeat="hotel.id as hotel in vm.hotels | filter: {active: true} | filter: $select.search">
        <div ng-bind-html="hotel.name | highlight: $select.search"></div>
    </ui-select-choices>
</ui-select>

但是,如果我在 ng-model 中使用变量,我的值会更改为 [null,null]。

我只需要更新我的 ui-select 的版本。

我以前用的是0.10.0版本

我更新到版本 0.11.2

只是一个错误!