Answers for "angular for loop index"

1

angular 7 for loop index ts

for (let i = 0; i < 3; i++) {
  console.log ("Block statement execution no." + i);
}
Posted by: Guest on April-21-2020
0

ngfor index

<ul>
    <li *ngFor="let item of items; let i = index" [attr.data-index]="i">
        {{item}}
        {{i}}
    </li>
</ul>
Posted by: Guest on August-24-2020

Browse Popular Code Answers by Language