When ng-repeat in angularJS iterates over keys of and object, it dafaults the order of keys as alphabetic. We are in a situation where we cannot use the collection as an array. Can someone suggest a proper solution where we can iterate over the keys of the object in the order in which they appear and not the default alphabetic order. Thanks in Advance.
-
Have you written something in your controller/HTML ?Vineet– Vineet2015-05-27 12:27:52 +00:00Commented May 27, 2015 at 12:27
-
Share us your code so we can help you.carton– carton2015-05-27 12:31:07 +00:00Commented May 27, 2015 at 12:31
-
I don't actually think that's true. ng-repeat over an object keys iterates using the order the keys are defined. Here is a plunker As an aside, it is not possible to orderBy object keys or values in ng-repeat. If you need an orderBy, you will have to create an array of the keys or values and ng-repeat over that.Alex– Alex2015-05-27 12:39:25 +00:00Commented May 27, 2015 at 12:39
-
There is some "solutions" of this at this post: stackoverflow.com/questions/19287716/…Luiz Rossi– Luiz Rossi2017-01-27 14:40:40 +00:00Commented Jan 27, 2017 at 14:40
Add a comment
|