Input Number Format Angular 2

353 views Asked by At

I am stuck in a problem i want do that wijmo-input-number field have mask like wijmo-date-input field.

Example: before enter field show:

(___)-________

After enter some data:

(123)-1245678

Note: without used JavaScript and jQuery. Your answer will be high appreciated.

1

There are 1 answers

0
Vega On

Here is a pattern that should do the trick :

regExp=/^(\(?[0-9]{3}\)?|[0-9]{3})( |-)?([0-9]{3}( |-)?[0-9]{4}|[a-zA-Z0-9]{7})$/