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

Set a default country dynamically #129

Open
dant672 opened this issue Jan 21, 2018 · 0 comments
Open

Set a default country dynamically #129

dant672 opened this issue Jan 21, 2018 · 0 comments

Comments

@dant672
Copy link

dant672 commented Jan 21, 2018

Is it possible to set the default country by passing through the country iso2 model. I have tried the following strategies:

  1. Assign the user country iso code to the default country option

<input class="schedule-input" type="text" name="phone" id="phone" international-phone-number ng-model="newAppointment.phone" ng-click="checkCountry()" default-country="{{user_country.iso}}" />
2) Set the default country in the controller:
angular.element('#phone').intlTelInput("selectCountry", 'gb')
angular.element('#phone').intlTelInput("setCountry", 'gb')

(tried both selectCountry and setCountry to no avail)

Any feedback would be helpful

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