Trying to iterate through a nested object structure with Angular TS:
{
"stringKey1": {
"child": [
{
"stringKey2": {
"child": []
}
},
{
"stringKey3": {
"child": []
}
},
{
"stringKey4": {
"child": [
{
"stringKey5": {
"child": []
}
},
{
"stringKey6": {
"child": []
}
}
]
}
}
]
}
}
Each "node" consists of a string key and an object {"child" : []} that may have multiple children with the same structure.
Attempts were made using *ngFor with pipe, and *ngIf to check if it is an array. However, it's difficult to predict the depth of the structure dynamically.
Tried various methods found online but still facing issues. Maybe overlooking something important.
Any suggestions or assistance would be greatly appreciated.
Thank you!