Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

247
Vistas
In angular-imask how do I use imaskElement attribute?

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 ?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda