How can I get children elements from QueryList in Angular 2?

前端 未结 2 1590
甜味超标
甜味超标 2021-02-04 01:23

I am newbie at Angular2. In my view I have few identical children that are generated in *ngFor.



        
2条回答
  •  眼角桃花
    2021-02-04 02:00

    I think you should be using the @ContentChildren attribute instead of the ViewChildren.

    @ContentChildren( OptionComponent )
    public Options: QueryList;
    

提交回复
热议问题