Here is a sample json data:
{
"id":14,
"discussion":8,
"parent":0,
"userid":2,
"subject":"communication skill discussion 2",
"message":"<p>hi all to communication discussion 2 </p>",
"children":[
24,
16,
15
]
},
{
"id":15,
"discussion":8,
"parent":14,
"userid":2,
"subject":"Re: communication skill discussion 2",
"message":"<p>hiiiiiiiiii</p>",
"children":[
25,
23
],
},
{
"id":23,
"discussion":8,
"parent":15,
"userid":2,
"created":1461562317,
"modified":1461562317,
"mailed":0,
"subject":"Re: communication skill discussion 2",
"message":"<p>helloooo</p>",
"children":[
],
}
I need assistance in looping through the json data using ng-repeat in angular. I want to start by fetching details of elements whose IDs correspond to the values in the children array. For example, for id:14, I want to retrieve details of id:15 since it's one of its children. Then continue to the next level of children if available, until we reach an element with no children and print its message.
Can you provide guidance on how to achieve this using ng-repeat in Angular?