Reputation: 1669
I have a table and one of the columns is status. Values of status are 'Open', 'Closed', 'Verified' and 'Rejected'. How to write a filter in ng-repeat, so that rows whose status is 'Closed' should not be displayed.
Upvotes: 0
Views: 34
Reputation: 28750
You should post some code of what you tried. Anyways...
ng-repeat="row in data | filter:{ Status: '!Closed' }"
Here's a jsFiddle show casing this:
Upvotes: 3
Reputation: 352
<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>
<label>Search: <input ng-model="searchText"></label>
<table id="searchTextResults">
<tr><th>Name</th><th>Phone</th></tr>
<tr ng-repeat="friend in friends | filter:searchText">
<td>{{friend.name}}</td>
<td>{{friend.phone}}</td>
</tr>
</table>
</body>
Upvotes: -2