The filter Filter
Thefilter
filter selects a subset of an array.The
filter
filter can only be used on arrays, and it returns an
array containing only the matching items.Example
Return the names that contains the letter "i":
<div ng-app="myApp" ng-controller="namesCtrl">
<ul>
<li ng-repeat="x in names |
filter : 'i'">
{{ x }}
</li>
</ul>
</div>