0

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>
Bhrungarajni
  • 2,415
  • 11
  • 44
  • 88

1 Answers1

1

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.

Billy Cottrell
  • 443
  • 5
  • 20