angular for each item code example
Example 1: ngfor
<li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
Example 2: angular for loop
let array = [1,2,3];
for (let i = 0; i < array.length; i++) {
console.log(array[i]);
}
<li *ngFor="let item of items; index as i; trackBy: trackByFn">...</li>
let array = [1,2,3];
for (let i = 0; i < array.length; i++) {
console.log(array[i]);
}