I have many instances of child component that creates via *ngFor. I want to use some method of selected one (I select one from parent). How I can do this?
Because ViewChild is not works (I have many components). Also ViewChildren also not working. Because I created it dynamically after some delay and ViewChildren have 0 length.
Thanks for any information.
just for example. _schedCompntnsArr have 0 length (but on page I have 4 componnets).
directives: [
SchedulerComponent
],
@ViewChildren(SchedulerComponent) schedCompntsList: QueryList<SchedulerComponent>;
ngAfterViewInit() {
this._schedCompntnsArr = this.schedCompntsList.toArray();
}