Here is how to get ViewContainerRef before @ViewChild query is evaluated
Too Long; Didn't Read
In one of my recent article on dynamic component instantiation <a href="https://hackernoon.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e">Here is what you need to know about dynamic components in Angular</a> I’ve shown the way how to add a child component to the parent component view dynamically. All dynamic components are inserted into a specific place in the template using ViewContainerRef reference. This is reference usually obtained by the specifying some template reference variable in the parent component template and then using queries like ViewChild inside the component to get it.