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

Parse Options Issue #55

Closed
mluyties opened this issue Mar 12, 2017 · 2 comments
Closed

Parse Options Issue #55

mluyties opened this issue Mar 12, 2017 · 2 comments

Comments

@mluyties
Copy link

Your js version is fantastic so far, so thank you =) However, I'm running in to one issue where I'm trying to parse a phone number but don't want to force a country code. I'd like it to figure out based on what is typed. But when I create the options object and pass it in to parse, I get this error:

Uncaught TypeError: Cannot read property 'default' of undefined
at e (libphonenumber-js.min.js:1)
at new e (libphonenumber-js.min.js:4)

I've tried multiple ways to create an object with different values for your two fields:

var options = {};
options.restrict = '';
options.default = 'US';

Thanks, Mike

@catamphetamine
Copy link
Owner

Learn how to format code on github

@catamphetamine
Copy link
Owner

Don't pass the second argument and there will be no default country

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

2 participants