Skip to content

In angular-imask how do I get the IMask class ? #655

Closed Answered by nelson777
nelson777 asked this question in Q&A
Discussion options

You must be logged in to vote

To help others that may find this question:

Based on this question, on Stackoverflow:

https://stackoverflow.com/questions/71772195/in-angular-imask-how-do-i-get-the-imask-class

I saw that it's possible using this method:

...
@ViewChild(IMaskDirective, { static: false }) iMask: IMaskDirective<IMask.MaskedNumber>;

ngAfterViewInit(): void { //or whatever
    this.iMask.maskRef.updateValue();
}

and it worked for me.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nelson777
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant