Answer the question
In order to leave comments, you need to log in
How to correctly display search results (angular)?
I use a simple filter
<input ng-model="searchText"></label>
<ul>
<li ng-repeat="friend in friends | filter:searchText">
</ul>
Answer the question
In order to leave comments, you need to log in
write your own filter. Something like:
<input ng-model="searchText"></label>
<ul>
<li ng-repeat="friend in friends | filter:mySearchFilter(searchText)">
</ul>
$scope.mySearchFilter = function(searchText) {
return function(value) {
return value.indexOf(searchText) !== -1;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question