A simple Angular 1 directive for Telephone input based off of intl-tel-input, with no jquery.
This library pulls in 2 important parts of the intl-tel-input library.
These get bundled into this library. We then mimic the layout of an input element from intl-tel-input.
Adds in a search ability, as navigating that dropdown is very hard.
var myApp = angular;
Create the directive:
on-number-validity-check : Callback for when we perform a validity check. Populates 3 variables
* $isValid: boolean - true if the number is considered valid. * $error: int - the error code for the number * $phoneNumber: string - a formated number in the style of INTERNATIONAL * $inputVal: string - the value put into the text box
show-search : If we should add in the search option to the input.
country : The default country we should use. This variable will be updated as the country gets changed.
Same as intl-tel-input except for search: