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 multiple countries #99

Open
vaduveerappan opened this issue Jul 25, 2017 · 1 comment
Open

Phone validation multiple countries #99

vaduveerappan opened this issue Jul 25, 2017 · 1 comment

Comments

@vaduveerappan
Copy link

Is it possible to allow multiple countries into phone validator?

These works individually :

  1. new FormControl(null, Validators.compose([Validators.required, CustomValidators.phone('US')])),
  2. new FormControl(null, Validators.compose([Validators.required, CustomValidators.phone('CA')])),

But when trying to do both ,"ERROR TypeError: Cannot read property '9' of undefined"

new FormControl(null, Validators.compose([Validators.required, CustomValidators.phone(['US','CA'])])),

Curious to know if there is multiple country support . If so how do we do?. Thank you

@ghost
Copy link

ghost commented Aug 9, 2017

Added this feature, see my pull request.

You can use it like CustomValidators.phone('EN', 'US')

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