I am trying to use the ui-select and the ponent 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].
I am trying to use the ui-select and the ponent 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].
Share edited May 20, 2015 at 12:55 luigibertaco asked May 20, 2015 at 11:31 luigibertacoluigibertaco 1,1425 silver badges23 bronze badges 3- Are there hotels with id 1 and 2? – dting Commented May 22, 2015 at 15:00
- can you please create a jsfiddle for your issue. – Waseem Bepari Commented May 22, 2015 at 15:09
- that is the problem, I have the same code working well in another controller, so, I need to know why this CAN happening, because it is not a default behaviour. – luigibertaco Commented May 22, 2015 at 23:30
1 Answer
Reset to default 10I 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!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742262095a4411094.html
评论列表(0条)