*ngIf and *ngFor on same element causing error

后端 未结 16 2108
自闭症患者
自闭症患者 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条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 02:48

    Angular v2 doesn't support more than one structural directive on the same element.
    As a workaround use the element that allows you to use separate elements for each structural directive, but it is not stamped to the DOM.

    
      
    {{log(thing)}} {{thing.name}}

    (