vag*_*lis 3 angularjs ui-select
我想找到一种方法来清除代码选择ui-select.
例如,我有以下代码
<ui-select ng-model="selectedCustomerCode" ng-if="CustomerIds.length>1" on-select="CustomerCodeFiltersOnSelectCallback($item, $model)" theme="bootstrap">
<ui-select-match class="ui-select-match" allow-clear="true" placeholder="??????? ??????? ??????...">{{$select.selected.CCode}}</ui-select-match>
<ui-select-choices class="ui-select-choices" repeat="customer in CustomerIds | propsFilter: {CCode: $select.search}">
<div ng-bind-html="customer.CCode | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
Run Code Online (Sandbox Code Playgroud)
我想碰上一个清晰的按钮并清除一些输入,包括ui-select.清除ui-select的代码是什么?
问题已经解决了.我不知道为什么,但只有selectedCustomerCodeng-model才能正常工作.我指定了selectedCustomerCode一个对象:
ng-model="selectedCustomer.selectedCustomerCode"
Run Code Online (Sandbox Code Playgroud)
然后我能够像这样清除它:
selectedCustomer.selectedCustomerCode = ''
Run Code Online (Sandbox Code Playgroud)
如果我有
ng-model="selectedCustomerCode"
Run Code Online (Sandbox Code Playgroud)
然后重新分配给:
selectedCustomerCode = ''
Run Code Online (Sandbox Code Playgroud)
不知何故不起作用.
| 归档时间: |
|
| 查看次数: |
5537 次 |
| 最近记录: |