How to clear all the values using ctrl+Z after numer being typed in angula8 using ngx-mask

224 Views Asked by At

mask for phone number field but here if i type some numbers and do ctrl+Z, it is not clearing all the values, when i do ctrlZ after typing, it must clear all the values present in it.

DEMO: DEMO

TS:

this.eoInfoForm = this.FB.group({
      amount: ['', Validators.required],
    });

HTML:

 <input [formControl]="eoInfoForm.control['amount']" mask='(000)-000-0000'><br>
1

There are 1 best solutions below

1
On BEST ANSWER

You can do this by adding an input, keyup.control.z and keyup.enter listener and combining it with a history array.

You can view this demo to see it working.