Currently, I am extracting data from an API in the form of a JSON object. The issue is that this JSON data is unordered by default. I am aware that JSON is meant to be unordered, but I would like to figure out how to loop through these keys and organize the data by storing them in an array. Currently, I have them displaying in a table using ng-repeat, but they appear in a random order. My ultimate goal is to have them sorted chronologically by date. Below is an example of the structure:
{
"01/05/2016": {
"Something1": {},
"Something2": {}
},
"01/01/2016": {
"Something1": {},
"Something2": {}
},
"01/03/2016": {
"Something1": {},
"Something2": {}
}
}
<tr ng-repeat="(key,value) in metrics_data">
<td align="center">{{key}}</td>
//and then I do another ng-repeat right here for values