How to use the new static option for @ViewChild in Angular 8?

Posted by Pinki | Updated on

In this example, I have shared how to use the new static option for @ViewChild in Angular 8? In most cases you will want to use {static: false}. Setting it like this will ensure query matches that are dependent on binding resolution (like structural directives *ngIf, etc…) will be found.

Example of when to use static: false:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers