for loop angular code example

Example 1: angular ngfor index

<ul>
    <li *ngFor="let item of items; let i = index" [attr.data-index]="i">
        {{item}}
    </li>
</ul>

Example 2: ng for until number

<li *ngFor="let number of [0,1,2,3,4]">{{number}}</li>

Example 3: angular 7 for loop index ts

for (let i = 0; i < 3; i++) {
  console.log ("Block statement execution no." + i);
}

Example 4: angular loop

<li *ngFor="let a of fakeArray; let index = index">Something {{ index }}</li>

Example 5: forloop angular

for (let i = 0; i < 3; i++) {
  console.log ("Block statement execution no." + i);
}

Example 6: angular javascript for loop

content_copy
      
      <h2>Products</h2>

<div *ngFor="let product of products">
</div>

Tags:

Html Example