Having trouble with the filter function in Angular JS when trying to filter a list using different links. I've been struggling to get it right even after trying some examples. Can anyone provide guidance on how to correctly filter the list?
HTML
<tr ng-repeat="rubric in examplerevisions | filter:myFilter" class="{{rubric.translationProposal.validations[0].class}}">
<td></td>
<td>{{rubric.translationProposal.validations[0].createdBy}}</td>
<td>{{rubric.translationProposal.validations[0].createdOn | date:'dd/MM/yyyy'}}</td>
<td>{{rubric.translationProposal.validations[0].action}}</td>
<td>{{rubric.action}}</td>
</tr>
<a href="" ng-click="myFilter = {action: 1}">OK</a>
<a href="" ng-click="myFilter = {action: 2}">New Proposal</a>
<a href="" ng-click="myFilter = {action: 3}">Null</a>
JS
In $scope.examplerevisions, all rows are contained.
JSON EXAMPLE ARRAY
{
"1":{
"id":1,
"action":1,
"translationProposal":{
"id":1,
"status":"ACCEPTED",
"createdOn":1393946608751,
"createdBy":12,
"validations":[
{
"id":0,
"action":"ACCEPT",
"proposedAlternative":"Alternate translation",
"createdOn":1393946608751,
"createdBy":12
}
]
}
}
}