I'm creating a mask with inputMask
, but the CPF is sent like this: 222.222.488-19
.
And I want it to have the mask of input
but at the time of sending it will be without the dots and dash. Type 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/]
}