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

2.1.4 • Public • Published

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

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

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

Weekly Downloads

12

Version

2.1.4

License

BSD-3-Clause

Unpacked Size

787 kB

Total Files

14

Last publish

Collaborators

  • jisay
  • blary_jp
  • antleblanc
  • ovh-ux-cds
  • lizardk
  • ovh
  • marie-j
  • anooparveti