ng-intl-tel-input icon indicating copy to clipboard operation
ng-intl-tel-input copied to clipboard

How to use the option "customPlaceholder" ?

Open krysbzh opened this issue 7 years ago • 2 comments
trafficstars

Hello, thank you very much for your directive, it works fine and it very easy to use. I use many options in my case (nationalMode, allowDropdown, placeholderNumberType...) and it's awesome. However, I need to customize the placeholder of my field and I don't know how to use the customPlaceholder option ?!

In the library intl-tel-input, he says that's a function... customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) { return "e.g. " + selectedCountryPlaceholder; }

Could you tell me if it's possible to use it with your angularjs directive ?

Thanks in advance

krysbzh avatar Mar 06 '18 10:03 krysbzh

Hello! Thank you for your interest in this module!

I believe this function is not implemented on our side. However, the code should be pretty simple to figure out: https://github.com/betsol/ng-intl-tel-input/blob/master/src/scripts/module.js.

If you would manage to implement this function, I will be glad to assist you with the PR.

slavafomin avatar Mar 06 '18 14:03 slavafomin

Thanks for your proposition. In fact, I have found a solution to use this option !

My controller var c = this; c.myPlaceHolder = function(selectedCountryPlaceholder, selectedCountryData) { return "Ex : " + selectedCountryPlaceholder; } HTML <input type="tel" id="mobilePhone" name="mobilePhone" ng-model="data.mobilePhone" intl-tel-input intl-tel-input-options="{allowDropdown:false, customPlaceholder: c.myPlaceHolder}" />

Best Regards Christophe

krysbzh avatar Mar 07 '18 15:03 krysbzh