mareczek / international-phone-number

AngularJS directive implementing intl-tel-input (https://github.com/Bluefieldscom/intl-tel-input)
139 stars 131 forks source link

Binding the number with country code directly to the model #95

Open Meldinoor opened 8 years ago

Meldinoor commented 8 years ago

Hi, When I enter a number into an input field with this directive, it would be nice if the number were to be bound with the country dial code directly to the model. Is there an option for this already?

What I mean is, say I have the following input:

image

It would be nice if the value bound to the model could automatically be "+46723135423" but instead I get "0723135423". I have to call intlTelInput('getNumber') to get the value and it's frustrating to have to do this manually everywhere in the code.

Would it be alright if I implemented an option for this and made a pull request? (I'm new to github, not sure yet about the etiquette of making pull-requests)

Thanks!

Jordumus commented 8 years ago

Hi meldinoor, did you ever get around that issue? If so, where can I find your solution?

Meldinoor commented 8 years ago

Hi Jordumus. I did fix it, but never got around to putting up a pull request. It's actually quite a small change, but I can make it available for you if you like.

Meldinoor commented 8 years ago

Give me a minute and I'll fork the project

Meldinoor commented 8 years ago

https://github.com/Meldinoor/international-phone-number

lindamarieb commented 7 years ago

Just set this option:

ipnConfig.nationalMode = false;