如何在angucomplete-alt中清空或清除输入

时间:2016-03-15 12:40:44

标签: angularjs

我无法动态清除



<angucomplete-alt 
  id="auto-clients"
  placeholder="Select Client"
  pause="100"
  selected-object="vm.curClient"
  initial-value="vm.client"
  local-data="vm.clients"
  search-fields="name"
  title-field="name"
  minlength="1"
  input-class="form-control"
  match-class="text-info" 
/>
&#13;
&#13;
&#13;

我可以使用function resetFilter() { vm.client = '' };之类的活动来完成 ?

2 个答案:

答案 0 :(得分:6)

$scope.$broadcast('angucomplete-alt:clearInput')

答案 1 :(得分:1)

仅清除一个自动完成输入值

$ scope。$ broadcast('angucomplete-alt:clearInput','autocomplete input id')