0

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.

4
  • Have you written something in your controller/HTML ? Commented May 27, 2015 at 12:27
  • Share us your code so we can help you. Commented 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. Commented May 27, 2015 at 12:39
  • There is some "solutions" of this at this post: stackoverflow.com/questions/19287716/… Commented Jan 27, 2017 at 14:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.