Having trouble displaying JSON data received as an HTTP web response.
Check out my HTTP request method below:
nodes: any;
ngOnInit(): void {
// Sending HTTP request:
this.http.get('/assets/TEST.json').subscribe(data => {
// Assigning JSON response to nodes.
this.nodes=data;
});
}
Now, here's the template code:
<div *ngFor="let node of nodes">
<p>{{node.description}}</p>
</div>
This is the JSON data being used:
{
"id": 1,
"name": "root1",
"link": "/login"
}
Encountering the following error in console:
Cannot find a differ supporting object '[object Object]' of type 'root1' where root1 is a different component from the original request.