Is mandatory to pass static flag for ViewChild?
In Angular 8, the static flag is required for ViewChild. Whereas in Angular9, you no longer need to pass this property. Once you updated to Angular9 using ng update, the migration will remove { static: false } script everywhere.
1 2 | @ViewChild(ChildDirective) child: ChildDirective; // Angular9 usage @ViewChild(ChildDirective, { static: false }) child: ChildDirective; //Angular8 usage |
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.