Simple AngularJs module to provide telephone country code data
# from the terminal at the root of your project
bower install angular-countrycodes --save
If you're not using wiredep you'll obviously also need to include the script in your html.
angular.module('xxxx', ['mcwebb.countrycodes'])
If you want, you can configure which countries will be returned at the top of the list. By default they'll just show A-Z. For each country you want add it's ISO Alpha-2 code to an array in the preferredCountries config method.
angular.module('xxxx')
.config(function (CountryCodesProvider) {
CountryCodesProvider.preferredCountries(['gb', 'us']);
});
angular.module('xxxx')
.controller('SignupController', function SignupController($scope, CountryCodes) {
$scope.countries = CountryCodes.getList();
});