diff --git a/js/intlpnIonic.js b/js/intlpnIonic.js index 3047321..33de985 100644 --- a/js/intlpnIonic.js +++ b/js/intlpnIonic.js @@ -304,9 +304,9 @@ angular.module('intlpnIonic', ['ionic', 'ionic_filter_bar']) scope.isocode = scope.intlpnHelper.getFlagFromNumber( ngModelCtrl.$viewValue ); scope.countryIsoCode = scope.isocode; if( scope.national ) { - scope.phone = intlTelInputUtils.formatNumberByType(ngModelCtrl.$viewValue,scope.isocode,intlTelInputUtils.numberFormat.NATIONAL); + scope.phone = intlTelInputUtils.formatNumber(ngModelCtrl.$viewValue, scope.isocode, intlTelInputUtils.numberFormat.NATIONAL); } else { - scope.phone = ngModelCtrl.$viewValue; + scope.phone = intlTelInputUtils.formatNumber(ngModelCtrl.$viewValue, scope.isoCode, intlTelInputUtils.numberFormat.INTERNATIONAL); } }; //from view value (in ngModel directive) to model value (outside world) diff --git a/package.json b/package.json index 488da10..79f7e80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "intl-pn-ionic", - "version": "0.2.2", + "version": "0.2.3", "description": "Simple version of intl-phone number input for Ionic", "main": "js/intlpnIonic.js", "scripts": {