lui*_*aco 19 html javascript frontend angularjs ui-select
我正在尝试使用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>
Run Code Online (Sandbox Code Playgroud)
屏幕上的变量"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>
Run Code Online (Sandbox Code Playgroud)
但是,如果我在ng-model中使用变量,我的值会更改为[null,null].
| 归档时间: |
|
| 查看次数: |
1345 次 |
| 最近记录: |