This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Using orderBy on an object should cause an error or warning #11255
Closed
Description
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?