Reset button in search input field using AngularJS

549 Views Asked by At

I am trying to create an search field with reset button which would clear text typed by the user. I am wondering how to place X or 'mulitiply' or maybe svg icon, at the right end of the input field and how to handle desired action in AngularJS 1.5.8 directive. Any ideas?

1

There are 1 best solutions below

2
On BEST ANSWER

check this fiddle

 <div class="input-prepend-inner pull-left" >
    <input ng-model="search.name"  placeholder="Filter">
         <span> <i class="add-on " ng-click="search.name = ''">X</i></span>
 </div>