OpenSource For You

Filters

-

A filter helps you in modifying the output to your view. You can subject your expression to any kind of constraint­s to give out the desired output. The format is:

{{ expression | filter }}

You can filter the output of filter1 again with filter2, using the following format:

{{ expression | filter1 | filter2 }}

The following code filters the members of the people array using the name as the criteria:

<body ng-init=" people=[{name:'Tony',branch:'CSE'}, {name:'Santhosh', branch:'EEE'}, {name:'Manisha', branch:'ECE'}];"> Name: <input type="text" ng-model="name"/> <li ng-repeat="person in people | filter: name"> {{person. name }} - {{person.branch}} </li> </body>

Newspapers in English

Newspapers from India