I have a component which has view child like this
@ViewChild('overView') content: ElementRef;
I am loading this component dynamically like this
var overviewComponent = this.vcr.createComponent(OverviewComponent);
var content = overviewComponent.instance.content;
var nativeElement = content.nativeElement;
But I am getting content as undefined.
I want to read the nativeElement of the content
Is there any way to read it?
I even tried this but it didn't help
@ViewChild('overView', {read: ViewContainerRef}) content: ElementRef;
Making the content static like this worked