AngularJS 1.5.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 NPM
npm install ng-intl-tel-input --save
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({initialCountry: '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 text or telng-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-initial-country="gb">