I want to filter result based on multiple fields.
HTML
<input type="text" ng-model="query">
<ul>
<li ng-repeat="x in phones | filter: search | orderBy:orderProp" >
<span>{{x.name}}</span>
<p> {{ x.id}} </p>
<p> {{ x.age}} </p>
</li>
</ul>
In my controller I mentioned,
$scope.search = function (item) {
return ( (item.name.indexOf($scope.query || '') ) !== -1 || (item.id.indexOf($scope.query || '')) !== -1);
};
Plnkr: http://plnkr.co/edit/a1khZS9RcFdgitTYPgqs?p=preview
why does the filter not working ? PS: I got error "TypeError: href is null" in firebug.