In my angular app I\'m trying to display JSON data in a table. The data looks like this:
$scope.data =
{
\"EVENT NAME\":\"Free Event\",
\"ORDER ID
A Javascript object does not have the concept of 'natural order' of its keys:
Definition of an Object from ECMAScript Third Edition (here):
4.3.3 Object An object is a member of the type Object. It is an unordered collection of properties each of which contains a primitive value, object, or function [...]
You probably should change a bit your data structure...
For example:
$scope.data =
{
1: { "EVENT NAME": "Free Event" },
2: { "ORDER ID": 311575707 },
/* ... */
};
And then use the numerical key to sort your items...