I have a table on which is implement sorting on columns and filter after a column (type).
It works fine if I use either orderBy or filter but does not work ( there is no data showed in the table) if there are both in ng-repeat.
This is the code:
<tr ng-repeat="rows in $ctrl.myData |
orderBy:$ctrl.sort.active:$ctrl.sort.descending track by $index |
filter: {Type:type} track by $index"
>
If I use like this it works the filter:
<tr ng-repeat="rows in $ctrl.myData | filter: {Type:type} track by $index">
and like this it works the ordering:
<tr ng-repeat="rows in $ctrl.myData | orderBy:$ctrl.sort.active:$ctrl.sort.descending track by $index">
Why isn't it work for both?
Probably the problem is caused by the presence of two
track by $index.Changing it to
solved the problem.