Reputation: 161
I want to mask material date control, for that I have tried two npm modules. first, I used ngx-mask and got this Error:
ERROR Error: More than one custom value accessor matches form control with unspecified name attribute
The Reason for the error is; ngx used ValueAccessor in their realization, but angular has a limitation -> we can use only one realization ValueAccessor. That's why ngx-mask doesn't work with material.refre
The Second solution is VanillaTextMask.js and I got some abnormal behavior:
If you try a date like "06/11/1983" you will see the model value is "06/11/1983_",and if you type another number it will get appended. refer
so, can anyone offer some other solution for implementing masking for angular material input control?
Upvotes: 9
Views: 29797
Reputation: 7326
Try with Text mask, they have to work with angular 2+. Example with stackblitz: https://stackblitz.com/edit/angular-gdqkir
Upvotes: 2