yuyang041060120 / ng2-validation

angular2 validation
https://yuyang041060120.github.io/ng2-validation/index.html
MIT License
610 stars 214 forks source link

Issue with CustomValidators.phone('de-CH') #104

Open AndrinGautschi opened 7 years ago

AndrinGautschi commented 7 years ago

Validation of a 'ch-DE' phone number isn't working with current version 4.2.0. It fails after three digits.

Workaround is setting version back to 3.9.1

baljeet commented 7 years ago

I had a similar issue with 'en-IN'. It was fixed by using 'IN' instead of 'en-IN'. Apparently, country metadata inside libphonenumber-js expects it in this format.

AndrinGautschi commented 7 years ago

@baljeet I already did that and it worked but the resulting validation was crappy. It didn't check for chars like 'A' or 'W' and the phone number was valid after a certain amount of characters.