I assume you are displaying items inside a dropdown using ng-repeat
. If So, you can simply use Angular built-in filter
. This is how it can look like, but I can't include that in your code, because you didn't provide it.
<div class="dropdown-options">
<div class="filter-input-container">
<input type="text" ng-model="searchText" class="filter" />
<i class="fa fa-search"></i>
</div>
<div class="option-container" ng-repeat="option in listOptions | filter:searchText">
<span>{{option.value}}</span>
</div>
</div>
With this code Angular will filter options insdie listOption
by a keyword you will type in input box. You have to bind your input element to a ng-model
which is in this case searchText
(name could be whatever you want) and then you have to tell the filter
what variable to use for filtering filter:searchText