hello i am having issues initializing viewchild elementRef this always work fine for me but in angular 13 i am having an error message
@ViewChild("text", { static: true }) text : ElementRef;
Property 'text' has no initializer and is not definitely assigned in the constructor
Thanks
CodePudding user response:
Change it to.
@ViewChild("text", { static: true }) text!: ElementRef;
Read more