paint-brush
Here is how to get ViewContainerRef before @ViewChild query is evaluatedby@maxim.koretskyi
2,049 reads
2,049 reads

Here is how to get ViewContainerRef before @ViewChild query is evaluated

by Maxim Koretskyi4mJuly 6th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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&nbsp;it.
featured image - Here is how to get ViewContainerRef before @ViewChild query is evaluated
Maxim Koretskyi HackerNoon profile picture
Maxim Koretskyi

Maxim Koretskyi

@maxim.koretskyi

L O A D I N G
. . . comments & more!

About Author

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite