admin管理员组文章数量:1334189
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!
本文标签: javascriptAngular uiselect multiple clean ngmodel valueStack Overflow
版权声明:本文标题:javascript - Angular ui-select multiple clean ng-model value - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742262095a2442702.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论