Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phone validation not working with greek country code #112

Open
vlaxos713 opened this issue Oct 18, 2017 · 0 comments
Open

Phone validation not working with greek country code #112

vlaxos713 opened this issue Oct 18, 2017 · 0 comments

Comments

@vlaxos713
Copy link

Hi,

It's my first ever comment on github, so apologies for any rules breaking.

I have used your library for a greek phone number validation, but unfortunately it doesn't work:
<input id="contactNumber" name="contactNumber" type="text" [(ngModel)]="model.contactNumber" #contactNumber="ngModel" phone="GR">
whereas with "US" country it does.

After debugging your, and libphonenumber, code the "phone/validator.ts" calls the "isValidNumber()" function (with 1 parameter -> {phone: v, country}) which takes the following route:
validate.js --> isValid()
metadata.js --> getTypes()
return metadata[9] -> this is undefined for 'GR', hence 'true' is returned

If i remove the '{ }' and call the 2 parameter overload of that method (such as below), it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant