I'm trying to create simple field for phone number with help of ngx-mask module like this:
<mat-form-field>
<input matInput formControlName="PhoneNumber" placeholder="Phone number" mask="(000) 0000-00" prefix="+1" [showMaskTyped]="true">
</mat-form-field>
It works, but value in control PhoneNumber is 999999999. How can i save in control value with mask, ie special symbols and prefix? Basically i need to save value which user sees: +1(999) 9999-99
Use [dropSpecialCharacters]="false"
<mat-form-field>
<input matInput formControlName="PhoneNumber" placeholder="Phone number" mask="(000) 0000-00" prefix="+1" [showMaskTyped]="true" [dropSpecialCharacters]="false">
</mat-form-field>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With