当有人点击搜索框angularJS时,我需要清除过滤器

时间:2016-03-03 01:09:28

标签: angularjs

我想清除过滤器或当有人点击搜索框时,它应该返回到href ="#/"

Code

<form name="search" ng-submit="search(asyncSelected)">
   <div class='input-group container-fluid' ng-controller="TypeaheadCtrl">
      <input type="text" autofocus="" ng-model="asyncSelected" placeholder="Search the directory by name" typeahead="user.sys_id as user.$$displayValue for user in getUsers($viewValue)" typeahead-input-formatter="formatLabel($model)" typeahead-focus-first="false" typeahead-on-select="onSelect($item, $model, $label)" typeahead-template-url="customTemplate.html" typeahead-loading="loadingUsers" class="input-lg form-control">
         <div class="input-group-btn">
            <button class="btn btn-primary btn-lg directory" ng-click="search(asyncSelected)"><i class="glyphicon glyphicon-search"></button>                                               
         </div>
      </input>
   </div>
</form>

我的搜索input

Search input

1 个答案:

答案 0 :(得分:0)

只需创建一个按钮进行重置并在控制器中设置。

std::vector