Reputation: 179
What is the correct syntax to switch from my simple ng-show
to a filter in my ng-repeat
? (item in list | filter:{item.value == 'abc'}
or so)
<ol ng-repeat="item in list">
<li ng-show="item.value == 'abc'">test</li>
</ol>
Upvotes: 0
Views: 71
Reputation: 2043
Do not use ng-repeat inside <ol>
tag.
This will repeat <ol>
tag each time with single <li>
.
Use ng-repeat in <li>
tag to repeat <li>
tag inside <ol>
tag and use filter with ng-repeat.
use like this :
<ol>
<li ng-repeat="item in list | filter: { value : 'abc' }">test</li>
</ol>
Upvotes: 1
Reputation: 213
You can use nf-repeat Filter
<ol ng-repeat="item in list | filter : {value : 'abc'}">
<li>test</li>
</ol>
Upvotes: 0
Reputation: 367
Try this
<ol ng-repeat="item in list | filter: {value: 'abc'}">
<li>test</li>
</ol>
Upvotes: 0
Reputation: 1574
<ol ng-repeat="item in list | filter:{value: 'abc'}">
<li>test</li>
</ol>
Plunker: https://plnkr.co/edit/uw0LNygWbj4Njhp1n7PN?p=preview
Upvotes: 0