I have a search input field and a listbox,
<input type="text" class="inputSearch" placeholder="Search" ng-model="searchRoleOne"/>
<i class="fa fa-search"></i>
<select multiple class="listMutiple top5" ng-model="selectedRoleValue">
<option ng-selected="selectrole" ng-repeat="role in roles | filter:searchRoleOne" value="{{role}}">{{role}}</option>
</select>
I need to addclass say
.addClear{
background: url(../images/Close.png) no-repeat right -10px center;
background-repeat: no-repeat;
background-position: right 5px center;
}
whenever there is text, i should happen on change function. And on clicking the .addClear class search field should get empty and so does the ng-model.
How can i do this?
I tried using ng-class="{'addClear': searchRoleOne}"
in search field. It isn't working properly.
Simply you can try with this
Fiddle here
Hope this may help you