Who can guide me on the best way to handle a data structure like this:
{
"1":{
"id":"1",
"name":"Facebook",
"created_at":"",
"updated_at":"",
"fields":{
"1":{
"id":"1",
"name":"G\u00f6rsel",
"service_id":"1",
"ord":"1",
"token":"fimage",
"type":"1",
"created_at":null,
"updated_at":null
},
"2":{
"id":"2",
"name":"Post Metini",
"service_id":"1",
"ord":"2",
"token":"ftext",
"type":"2",
"created_at":null,
"updated_at":null
},
"3":{
"id":"3",
"name":"Ba\u015fl\u0131k",
"service_id":"1",
"ord":"3",
"token":"fheader",
"type":"2",
"created_at":null,
"updated_at":null
},
"4":{
"id":"4",
"name":"Link A\u00e7\u0131klamas\u0131",
"service_id":"1",
"ord":"4",
"token":"flink_description",
"type":"2",
"created_at":null,
"updated_at":null
}
}
},
"2":{ },
"3":{ }
}
I have observed that Angular functions such as sorting, filtering, and looping through data are based on javascript arrays. What is the recommended method of handling similar structures in Angular 4 for functionalities like *ngFor, filters, etc.? When attempting to iterate over this object with NgFor, I encounter:
Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
At this point, I am uncertain about the best course of action. I could convert the object to an array, but is that the optimal approach?