AngularJS 1.4.x module implementing intl-tel-input directive (https://github.com/Bluefieldscom/intl-tel-input)
ngIntlTelInputProvider
is available to set configs in the module config phase.
Operates as a normal validator for a form input based on the selected country.
Assigns the final formatted telephone number to the ng-model binding.
http://hodgepodgers.github.io/ng-intl-tel-input/
With Bower
bower install ng-intl-tel-input --save
Manually
git clone https://github.com/rswebteam/ng-intl-tel-input.git
Inject ngIntlTelInput
into your application module
var myApp = angular.module('myApp', ['ngIntlTelInput']);
Configure defaults
See: https://github.com/Bluefieldscom/intl-tel-input#options
angular.module('myApp')
.config(function (ngIntlTelInputProvider) {
ngIntlTelInputProvider.set({defaultCountry: 'us'});
});
This attribute applies intl-tel-input to a text field.
<input type="text" ng-model="model.tel" ng-intl-tel-input>
Note
type
is set to textng-model
is specified (required)
This attribute allows run-time setting of the default country.
<input type="text" ng-model="model.tel" ng-intl-tel-input data-default-country="gb">