Monday, March 18, 2019

Angular 5: Iterate array and list out elements

To iterate through an array.

In component file:

   goals = [];

In html file:

use ngFor:

<div class="col">
    <p class="life-container" *ngFor="let goal of goals">
      {{ goal }}
    </p>
</div>

No comments:

Post a Comment