Answer the question
In order to leave comments, you need to log in
How to implement ViewChild in Angular?
Child component of EditPanelComponent. I'm trying to access it via ViewChild.
The object is not defined . I've read a lot. Tried different options.
It turns out that ViewChild cannot be used at all...???
If anyone knows, tell me how???
@ViewChild(EditPanelComponent)
private editPanelComponent: EditPanelComponent;
ngAfterViewInit() {
console.log(this.editPanelComponent); // undefined DOESN'T WORK
}
Answer the question
In order to leave comments, you need to log in
What's in the markup? Everything is fine with ViewChild,
https://stackblitz.com/edit/angular-ivy-2hljgw?dev...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question