@ovh-ux/ng-ovh-simple-country-list
v2.1.2
Published
OVH simple country list provide a 'full' (ISO-3166-1) list of countries with translation possibility.
Downloads
93
Readme
ng-ovh-simple-country-list
OVH simple country list provide a "full" (ISO-3166-1) list of countries with translation possibility. (translations are not available yet)
Install
$ yarn add @ovh-ux/ng-ovh-simple-country-list
Usage
import angular from 'angular';
import ngOvhSimpleCountryList from '@ovh-ux/ng-ovh-simple-country-list';
angular.module('myApp', [ngOvhSimpleCountryList]).controller(
'myController',
/* @ngInject */ (OvhSimpleCountryList) => {
// Set the desired language (default is iso/en).
OvhSimpleCountryList.setLanguage('en_GB');
console.log(OvhSimpleCountryList.asDataForSelect);
/*
[
{'value':'AD', 'label': 'ANDORRA'},
{'value':'AE', 'label': 'UNITED ARAB EMIRATES'},
...
]
*/
console.log(OvhSimpleCountryList.asArray);
//= > ['ANDORRA', 'UNITED ARAB EMIRATES', 'AFGHANISTAN', ...]
console.log(OvhSimpleCountryList.asObject);
//= > {'AD': 'ANDORRA', 'AE': 'UNITED ARAB EMIRATES', ... }
},
);
Test
$ yarn test
Contributing
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
License
BSD-3-Clause © OVH SAS