You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Over in #1286 it was decided that orderBy should not be modified to work when doing an ng-repeat over an object.
However, trying to use orderBy on an object doesn't give any clue as to what you're doing wrong; the ordering simply silently fails to take effect: http://jsfiddle.net/uo7kym1n/1/
I just got bitten by this behaviour and the idea that using orderBy on an object was wrong was certainly not the first idea that came to my mind. I suspect the 50 people who +1ed #1286 are likewise people who lost time trying to make sense of why their orderBy wasn't working without Angular offering them any clues.
Would it not be reasonable to have orderBy throw an error or warning when used on an object, instructing that it should not be so used?
The text was updated successfully, but these errors were encountered:
BREAKING CHANGE:
Previously, an non array-like input would pass through the orderBy filter
unchanged.
Now, an error is thrown. This can be worked around by converting an object
to an array, either manually or using a filter such as
https://github.com/petebacondarwin/angular-toArrayFilter.
(`null` and `undefined` still pass through without an error, in order to
support asynchronous loading of resources.)
Closesangular#11255Closesangular#11719
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Over in #1286 it was decided that
orderBy
should not be modified to work when doing an ng-repeat over an object.However, trying to use
orderBy
on an object doesn't give any clue as to what you're doing wrong; the ordering simply silently fails to take effect: http://jsfiddle.net/uo7kym1n/1/I just got bitten by this behaviour and the idea that using
orderBy
on an object was wrong was certainly not the first idea that came to my mind. I suspect the 50 people who +1ed #1286 are likewise people who lost time trying to make sense of why their orderBy wasn't working without Angular offering them any clues.Would it not be reasonable to have
orderBy
throw an error or warning when used on an object, instructing that it should not be so used?The text was updated successfully, but these errors were encountered: