2
I’m creating a mask with inputMask
, but the number is received so: 222.222.488-19
.
And I want him to have the mask on input
but when sending it will be without the dots and the dash. Like this 22222248819
. My code:
@Component({
selector: 'app',
template: `
<input [textMask]="{mask: mask}" [(ngModel)]="myModel" type="text"/>
`
})
export class AppComponent {
public myModel = ''
public mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
}
If this solves your problem, mark as answered.
– Risk