Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda