Reputation: 13773
I am trying to filter some data on a string value but I can't get the syntax right. Here is my code :
<tbody ng-repeat="qbRating in vm.scope.qbRatings | filter:'tournament.season.seasonName':'2022' | ratingFilter | orderBy:'-rating'">
<tr class="qbrating2022">
<td>{{ qbRating.tournament.season.seasonName }}</td>
<td>{{ qbRating.team.teamName }}</td>
<td>{{ qbRating.completion }}</td>
<td>{{ qbRating.gain }}</td>
<td>{{ qbRating.touchdown }}</td>
<td>{{ qbRating.interception }}</td>
<td>{{ qbRating.rating }}</td>
</tr>
</tbody>
The filter does not return any data even though it should do, but there is no error returned in the console.
Can anybody help me get the syntax right?
Upvotes: 2
Views: 204
Reputation: 136144
You should put filter on specific property by specifying object to be match like filter: {'tournament': {season : {seasonName:'2022'}}}
ng-repeat="qbRating in vm.scope.qbRatings | filter: {'tournament': {season : {seasonName:'2022'}}} | ratingFilter | orderBy:'-rating'"
Upvotes: 3