*ngIf and *ngFor on same element causing error

后端 未结 16 2452
自闭症患者
自闭症患者 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 02:58

    On other solution might be to put an empty array in your for loop in the case where you don't want to display it

    Where "stuff" is an array of "thing" and "show" the boolean to display or not the content

提交回复
热议问题