AngularJS directive to generate a list of countries as options of the select element.
You can install the directive using Bower:
$ bower install angular-country-picker
$ npm install angular-country-picker
Then you have to include it in your HTML:
And inject the module
puigcerber.countryPicker as a dependency of your application:
ngOptions, any other optional attribute of the select directive could still be used.
The default value to which
ngModel is bound it's the two-letter country code, but this can be changed setting the
attribute to one of the following values:
- alpha2: two-letter country code defined in ISO 3166-1 alpha-2.
- alpha3: three-letter country code defined in ISO 3166-1 alpha-3.
- numeric: three-digit country code defined in ISO 3166-1 numeric.
- name: the English name of the country.
The country provider can be configured to set a custom list of countries.
ISO 3166 is the International Standard for country codes and codes for their subdivisions. Currently 249 countries, territories, or areas of geographical interest are assigned official codes in ISO 3166-1.