Reputation: 133
I am new to angular. I have array data. I want to display data on my webpage.
my question is how to print data. the data showing in console.log().
My console.log screenshot
Upvotes: 3
Views: 95
Reputation: 36
<div *ngFor='let measurement of ObjectName.measurements'>
{{ measurement?.label }}
</div>
For more info please visit the angular tutorial
https://angular.io/tutorial/toh-pt2
Upvotes: 1
Reputation: 222572
In order to display array on your template you need ngFor
<ul>
<li *ngFor="let measurement of data.measurements">
{{ measurement }}
</li>
</ul>
Upvotes: 1
Reputation: 86730
You can iterate over the array in a webpage using *ngFor
directive of Angular for example -
<div *ngFor='let item of arrayName'>
{{item?.propertyName}}
</div>
Upvotes: 1