UNPKG

ng-intl-tel-input

Version:

AngularJS directive implementing intl-tel-input (https://github.com/Bluefieldscom/intl-tel-input)

27 lines (25 loc) 666 B
angular.module('ngIntlTelInput') .provider('ngIntlTelInput', function () { var me = this; var props = {}; var setFn = function (obj) { if (typeof obj === 'object') { for (var key in obj) { props[key] = obj[key]; } } }; me.set = setFn; me.$get = ['$log', function ($log) { return Object.create(me, { init: { value: function (elm) { if (!window.intlTelInputUtils) { $log.warn('intlTelInputUtils is not defined. Formatting and validation will not work.'); } elm.intlTelInput(props); } }, }); }]; });