Working on a AngularJS application that involves handling a complex JSON file with multiple nested arrays and objects. My query is: Is it appropriate to use ng-repeat repeatedly for accessing the data from the JSON?
<div ng-repeat="parent in parents">
<div ng-repeat="child in parent">
<div ng-repeat="grandChild in child">
{{grandChild.name}}
</div>
</div>
</div>
----- OR is there a more efficient looping method available in AngularJS
----- OR should we resort to using the old JavaScript for
loop?
Sample data
{"data":
{
"categories":
{
"articles":
{
"bdh":
[
{"id":1, "name":"bdh article 1", "body":"this is bdh article 1 body."},
{"id":2, "name":"bdh article 2", "body":"this is bdh article 2 body."}
],
"hadoop":
[
{"id":3, "name":"hadoop article 1", "body":"this is hadoop article 1 body."},
{"id":4, "name":"hadoop article 2", "body":"this is hadoop article 2 body."}
]
},
"videos":
{
"bdh Videos":
[
{"id":5, "name":"bdh videos 1", "body":"this is bdh videos 1 body."},
{"id":6, "name":"bdh videos 2", "body":"this is bdh videos 2 body."}
],
"hadoop Videos":
[
{"id":7, "name":"hadoop videos 1", "body":"this is hadoop videos 1 body."},
{"id":8, "name":"hadoop videos 2", "body":"this is hadoop videos 2 body."}
]
}
}
}
}