Angular 2: How to write a for loop, not a foreach loop

后端 未结 9 534
甜味超标
甜味超标 2020-12-05 09:41

Using Angular 2, I want to duplicate a line in a template multiple times. Iterating over an object is easy, *ngFor="let object of objects". However, I

9条回答
  •  孤街浪徒
    2020-12-05 09:47

    Depending on the length of the wanted loop, maybe even a more "template-driven" solution:

    • {{ index }}

提交回复
热议问题