*ngFor on ng-template outputs nothing Angular2

后端 未结 2 1352
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 13:02

Not sure why my *ngFor loop is printing nothing out. I have the following code in an html file:

相关标签:
2条回答
  • 2020-12-08 13:39

    I think what you want is

    <ng-container *ngFor="let xb of tempData">
    

    or

    <ng-template ngFor let-xb [ngForOf]="tempData">
    
    0 讨论(0)
  • 2020-12-08 13:51

    For getting index as well: <ng-template ngFor let-xb [ngForOf]="tempData" let-index="index">

    0 讨论(0)
提交回复
热议问题