3

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

enter image description here

3 Answers 3

1

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>

Working Example

Sign up to request clarification or add additional context in comments.

Comments

1

In order to display array on your template you need ngFor

<ul>
    <li *ngFor="let measurement of data.measurements">
      {{ measurement }}
    </li>
</ul>

Comments

1
<div *ngFor='let measurement of ObjectName.measurements'>
    {{ measurement?.label }}
</div>

For more info please visit the angular tutorial

https://angular.io/tutorial/toh-pt2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.