我正在尝试在 ngx-mask 模块的帮助下为电话号码创建简单的字段,如下所示:
<mat-form-field>
<input matInput formControlName="PhoneNumber" placeholder="Phone number" mask="(000) 0000-00" prefix="+1" [showMaskTyped]="true">
</mat-form-field>
它可以工作,但控制 PhoneNumber 中的值是 999999999。如何使用掩码(即特殊符号和前缀)保存控制值?基本上我需要保存用户看到的价值:+1(999)9999-99