@ovh-ux/ng-ovh-simple-country-list

OVH simple country list provide a 'full' (ISO-3166-1) list of countries with translation possibility.

Usage no npm install needed!

<script type="module">
  import ovhUxNgOvhSimpleCountryList from 'https://cdn.skypack.dev/@ovh-ux/ng-ovh-simple-country-list';
</script>

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)

npm version Downloads Dependencies Dev Dependencies

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