Please enable JavaScript.
Coggle requires JavaScript to display documents.
ViewChild - Coggle Diagram
ViewChild
-
-
Static stands for whether the ViewChild is “static” content e.g. Always available on the page, no matter page bindings, API calls, ngIfs etc. When set to true, we are telling Angular that the ViewChild will be available at anytime, so simply query for the ChildComponent at the earliest lifecycle hook available and then never query again.
if we set static to false, we are saying that the ViewChild will be available at a later time, but it’s dependant on a condition (Such as an API call, or a simple component property binding), and therefore we must check for the ViewChild every time ChangeDetection runs.
Accessing template of same component as well as child component, directive and html elements. This can be only read after ngAfterViewInit(). i.e once the view render then only we can access the properties
-
-