PeteCon
0
Q:

how to loop a number in ngfor

//my.component.ts

counter(i: number) {
    return new Array(i);
}
//my.component.html

<li *ngFor='let in of counter(5) ;let i = index'>{{i}}</li>
0

New to Communities?

Join the community