Angular 2 *ngFor - Conditional wrapper element. Like using bootstrap row with three columns inside, then add a new row

后端 未结 5 1305
挽巷
挽巷 2021-01-15 12:00

I am using *ngFor and it has me perplexed. I am trying to use UIkit but it would be applicable to Bootstrap also.

5条回答
  •  孤独总比滥情好
    2021-01-15 12:15

    Just use index that directive provides

    like

    *ngFor="let device of devices ; let i = index"

    then in the html just check with *ngIf and add your block

    like

    Probaly you need this approach Ng-repeat-start in angular2 - aka repeat multiple elements using NgFor

    (in AngularJS 1.x it was pair of directives ng-repeat-start ng-repeat-end, now it's another approach for the same)

提交回复
热议问题