Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does the groupBy doesn't works correctly with native orderBy filter? #148

Open
tavai89 opened this issue Aug 25, 2015 · 3 comments
Open

Comments

@tavai89
Copy link

tavai89 commented Aug 25, 2015

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

@a8m
Copy link
Owner

a8m commented Aug 25, 2015

Hi @tavai89
PTAL on issue-26, and let me know if there's any questions.
Thanks.

@tavai89
Copy link
Author

tavai89 commented Aug 26, 2015

Hi @a8m

Firstly, thank you a lot for your response. I have found the solution for my issue here:

#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

@solidevolution
Copy link

Performance of toArray:true solution is bad with angular 1.4.8.

Do you have another/better solution in 2017 for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants