*ngIf and *ngFor on same element causing error

后端 未结 16 2266
自闭症患者
自闭症患者 2020-11-22 02:37

I\'m having a problem with trying to use Angular\'s *ngFor and *ngIf on the same element.

When trying to loop through the collection in th

16条回答
  •  一整个雨季
    2020-11-22 03:13

    You can also use ng-template (instead of template. See the note for the caveat of using template tag) for applying both *ngFor and ngIf on the same HTML element. Here is an example where you can use both *ngIf and *ngFor for the same tr element in the angular table.

    
        
                                                            
提交回复
热议问题