AngulaJS Filter 'filter' demo
HTML
<script src="https://code.angularjs.org/1.3.1/angular.js"></script>
<body ng-app="">
<div ng-init="friends = [{name:'John', phone:'555-1276'},
{name:'Mary', phone:'800-BIG-MARY'},
{name:'Mike', phone:'555-4321'},
{name:'Adam', phone:'555-5678'},
{name:'Julie', phone:'555-8765'},
{name:'Juliette', phone:'555-5678'}]"></div>Search:
<input ng-model="searchText">
<!-- SEARCH BY ANY PROPERTY ---------------------------------------------------->
<table id="searchTextResults">
<tr>
<th>Name</th>
<th>Phone</th>
</tr>
<tr ng-repeat="friend in friends | filter:searchText | orderBy:'name' ">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
</tr>
</table>
<br/>
<!-- SEARCH BY SPECIFIC PROPERTIES ----------------------------------------------->
<hr>
<br/>Any:
<input ng-model="search.$">
<br>Name only
<input ng-model="search.name">
<br>Phone only
<input ng-model="search.phone">
<br>Equality
<input type="checkbox" ng-model="strict">
<br>
<table id="searchObjResults">
<tr>
<th>Name</th>
<th>Phone</th>
</tr>
<tr ng-repeat="friendObj in friends | filter:search:strict | orderBy:'name'">
<td>{{friendObj.name}}</td>
<td>{{friendObj.phone}}</td>
</tr>
</table>
</body>