Closed BaurzhanSakhariev closed 2 years ago
Hi BaurzhanSakhariev, Have you got the country code? i am also stuck on that. Please help.
try
angular.element("#phone").intlTelInput("getSelectedCountryData")
it will retun the object
Object {name: "United States", iso2: "us", dialCode: "1", priority: 0, areaCodes: null}
I tried to use
<input type="text" international-phone-number preferred-countries="kz" ng-model="data" country="countryData" required>
but my countryData variable not populated.I rebuilt directive withseparateDialCode: true
(changed plugin javascript directly) and managed to get withput_dial to ng-model but didn't manage to get dialCode. How to do it?I even tried to add my own variable to directive but couldn't find correct place to paste code like
scope.myOwnVarInDirective = element.intlTelInput('getSelectedCountryData')
. I tried to put such code in watch ngModel afterctrl.$modelValue = newValue;
but failed - even simple debuggin cosole.log not triggered(What is the place in directive where i should play with my own variable andd pass needed data? May be there exist already implemented way to grab dial code into angular variable?