Filter list from similar strings

0

My question is how do I, using the angularjs filter, to filter items in a list from string attributes. These attributes are similar, 'relevant' and 'non-relevant'.

<select class="select input" ng-model="classes">
    <option value="rel">relevant</option>
    <option value="non-rel">non-relevant</option>
 </select>
<tbody>
    <tr ng-repeat="post in posts | filter:{classification:classes}">
...

The problem is that when I put in the "relevant" select, it brings all together. You can only bring it specifically if it is non-relevant. I would like to know if I have to return only those that only have "relevant" or only those that have "non-relevant". How could I solve this problem? Thanks for your help one more time. Hugs.

    
asked by anonymous 16.09.2017 / 02:18

1 answer

0

The filter accepts a third parameter that basically forces the value to be exact:

...
<tr ng-repeat="post in posts | filter:{classification:classes}:true">
...

You can check the filter documentation.

    
16.09.2017 / 02:32