I'm trying to find a way to access the imask object in Angular. I saw this attribute
[imaskElement]="(elementRef, directiveRef) => maskElement" <!-- default = elementRef.nativeElement -->
but when I try to connect it to a property in my component it doesn't work. Angular can't find elementRef and directiveRef properties in the component.
I tried to connect it to this property:
@ViewChild('MyDatePicker') myDatePicker: ElementRef;
this way:
(...)
[imaskElement]="(elementRef, directiveRef) => datePickerElement" />
Also if I try to access the default element as stated in the documentation it doesn't work. When I try this:
myDatePicker.nativeElement.updateValue()
I get this error:
ERROR TypeError: Cannot read properties of undefined (reading 'updateValue')
How can I correctly direct imaskElement attribute to a property of my component ?