ng-intl-tel-input
ng-intl-tel-input copied to clipboard
How to use the option "customPlaceholder" ?
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
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.
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