Angular 12 input mask that will accept all type of character include space and special character

Viewed 23

enter image description here

[enter image description here][2]enter image description here

below is my code images now I am using ngx-mask for input type number its working for numbers but when I try to implement it for text that will enter any type of character its not working, specially spaces and other special characters

<input type="text" (click)="clickInput()" id="cm_{{controllerName}}" 
       [mask]="mask" [patterns]="customPattern" class="form-control ac-number" 
       [formControlName]="controllerName"
       [hiddenInput]="!isShow" autocomplete="off" [class.disabled]="disabledValue"
       (keyup)="changesvalue()" (focus)="ssnFocus()" (blur)="validateSSN()"
       validateOnBlur [validateFormControl]="control.controls[controllerName]"
       (keydown)="checkMfa()" />"
ngOnInit(): void {
  this.customPattern = { 'V': { pattern: new RegExp('\\w'), symbol: 'X' }, 'A': { pattern: new RegExp('\\w'), optional: true, symbol: 'X' } };
  this.mask = 'VA{100}';   
}

i want to show input like this

0 Answers
Related