I am struggling to access the user item view from a json array called dealerLst. The complexity of the json is causing issues for me in accessing multiple users. Can someone guide me on how to access all children using angular or typescript? Additionally, I need help figuring out how to determine which children belong to which parent.
Here's my code: Click here to see my json output result
Typescript snippet
this.http.get<any>(environment.baseurl,{ headers }).subscribe({
next: data => {
console.log(data)
this.dealers = data.dealerLst
console.log(data.dealerLst.user)
this.total=data.total
},
error: error => {
console.error('An error occurred!', error.message);
}
});
The output is showing undefined. I also attempted to use an ngFor loop but with no success.