*ngIf and *ngFor on same element causing error

后端 未结 16 2104
自闭症患者
自闭症患者 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:01

    As everyone pointed out even though having multiple template directives in a single element works in angular 1.x it is not allowed in Angular 2. you can find more info from here : https://github.com/angular/angular/issues/7315

    2016 angular 2 beta

    solution is to use the