Подтвердить что ты не робот

Angular ui-select несколько значений чистой ng-модели

Я пытаюсь использовать 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-модели, мое значение изменится на [null, null].

4b9b3361

Ответ 1

Мне просто нужно обновить версию моего ui-select.

Я использовал версию 0.10.0

Я обновил версию до версии 0.11.2

Просто ошибка!