Problem
For example, the parameter has the following type { component: any; element: ElementRef; }
, of which I only want the element:
onTextBoxInit({ element }) { }
Question: How can I set the type of this destructured element?
Tried
I thought of something like this: onTextBoxInit({ element: ElementRef }) { }
, however this is not working.
You need to specify the type of the argument after the destructuring expression
onTextBoxInit({ element }: {element: ElementRef }){}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With