ngx-custom-validators icon indicating copy to clipboard operation
ngx-custom-validators copied to clipboard

Support phone number validation

Open YZahringer opened this issue 6 years ago • 5 comments

Adding support for validating a phone number would be helpful.

YZahringer avatar Jun 19 '18 16:06 YZahringer

In order to have a phone validators, I would have to include phonelib.

If more people ask for this, I will do it but my first goal is having a lightweight package without third party or library.

rsaenen avatar Jun 27 '18 07:06 rsaenen

Ralf, could you have a phonevalidator:

  • testing the existence of the library phonelib
  • if present, use it
  • if not, either do nothing or raise an error

Cheers mate ;) /tm

kktos avatar Feb 27 '19 12:02 kktos

Third the request. I tried moving to ngx-custom-validators as ng2-validator wasnt being updated. The switch was smooth, except for the phone validator. Will be very helpfull.

vaduveerappan avatar Feb 07 '20 21:02 vaduveerappan

Upgraded to Angular 9 and ng2-validator gave errors. Would be helpful to have it in as phone number is a common field type so it probably belongs in here.

juanreynolds avatar Feb 12 '20 04:02 juanreynolds

A branch with libphonenumber-js exists with the phone validation.

Unfortunately, it has an issue... 0668744565 (locale FR) is valid and should works but validation errors is not updated.

All TU passed btw.

rsaenen avatar Feb 24 '20 12:02 rsaenen