angular-filter
angular-filter copied to clipboard
Does the groupBy doesn't works correctly with native orderBy filter?
Looks like when I trying to use native angular orderBy filter along with the groupBy filter the first doesn't affect the result:
ng-repeat="(key, value) in collection | orderBy: '-OccurredOnDate' | groupBy: groupBy"
Any thoughts?
Thanks in advance
Hi @tavai89 PTAL on issue-26, and let me know if there's any questions. Thanks.
Hi @a8m
Firstly, thank you a lot for your response. I have found the solution for my issue here:
https://github.com/a8m/angular-filter/issues/57
In the jsbin you have posted:
http://jsbin.com/hopowowodu/1/edit?html,js,output
The solution was:
ng-repeat="group in collection | groupBy: groupBy | toArray:true | orderBy: '-$key'"
since I wanted to order the groups, not the items in groups.
Thank you
Performance of toArray:true solution is bad with angular 1.4.8.
Do you have another/better solution in 2017 for me?