Hi,
I have a JSON object and i want to display it in a view.
<div >{{ pat | json }}</div>
display
{ "id": 1, "label": "pat 1"}
display
[object Object]
But if i type
I have the following error
ORIGINAL EXCEPTION: TypeError: Cannot read property 'id' of undefined
My question : How to display the properties of my JSON object ?
NB : if i have une list of Json object [{ "id": 1, "label": "pat 1"},{ "id": 2, "label": "pat 2"}]
the following code works
<li *ngFor="let pat of pats" >
{{ pat.id }} - {{ pat.label}}
</li>
display
1 - pat 1
2 - pat 2