I am currently learning AngularJS, and I am trying to achieve a JSON complex object displayer. I've read quite a lot about this kind of question in this question or even here, and there are elements of response, but those aren't quite helping me in my case.
The topic mentionned before showed me some good solutions when children always bear the same name (e.g, the child element is always called "Children" for example 1). But how can we deal with different names ? I searched for a way to get the children objects regardless of it's name, but didn't find it.
My JSON object looks like this:
{
name: "Something",
_id: "some ID",
Firstchildren: [
{
name: "Children1"
type: "Child"
SecondChildren: [
{
name: "ChildrenOfDoom",
type: "Doom"
ThirdChildren: [
{
name: "BoredOne",
type: "Bored
},
{
name: "AnotherOne",
type: "Boring"
}
]
},
<another SecondChildren>
]}
Basically my question is the following: is there a way to deal with complex JSON object recursively regardless of the children's name ? So, in our example, to end up with a display like:
Something
Child1 : Child
ChildrenOfDoom : Doom
BoredOne : Bored
AnotherOne : Boring
ChildrenOfChaos : Chaotic
SomeOne : Random
...
...
Child2 : Child
...
And, of course, if there are such ways, I would like to find out about it, whether it is complete solution, advices, documentation or useful tutorials.
Thank you in advance !
PS: If possible, avoid the "possible duplicate of " if they are already linked in the original question, I already went through. PPS: Despite the first above, I am not closed to other related questions either, as long as they are not already quoted here.