Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular ui-select multiple clean ng-model value

I am trying to use the ui-select and the component is cleaning my array.

Example:

{{ 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>

My variable "vm.staff_hotels" value on screen is [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>

but, if I use the variable in ng-model my value change to [null,null].

like image 768
luigibertaco Avatar asked May 20 '15 11:05

luigibertaco


1 Answers

I just need to update the version of my ui-select.

I used to use version 0.10.0

I updated to version 0.11.2

Just a bug!

like image 127
luigibertaco Avatar answered Sep 17 '22 18:09

luigibertaco