I am in need of a JSON parsing guide that allows me to navigate through questions and locate child questions based on the Yes section. I have been unable to find any resources specifically addressing how to check for child nodes in JSON, with Angular being my preferred framework.
Some potential use cases include:
- Displaying the Root question upon loading,
- Displaying subsequent child questions based on user selection from the root node, then progressing forward,
- Navigating through various questions within the tree structure.
treeObj={
"Root_Element": {
"id": "myTree",
"dt": {
"choice": {
"id": '0',
"title": "Which color",
"description": "Choose color ?",
"choice": [
{
"id": 1,
"title": "Yellow",
"description": "Yellow ? ,
"choice": [
{
"id": 5,
"title": "Dark Yellow",
"description": "Dark Yellow ?
},
{
"id": 4,
"title": "Light Yellow",
"description": "Light Yellow ?
}
]
},
{
"id": 2,
"title": "Red",
"description": "Red ?"
},
{
"id": 3,
"title": "Green",
"description": "Green ?
}
]
}
}
}
}