angular-country-picker

WebJar for angular-country-picker

Лицензия

Лицензия

MIT
Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

angular-country-picker
Последняя версия

Последняя версия

2.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-country-picker
WebJar for angular-country-picker
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/Puigcerber/angular-country-picker

Скачать angular-country-picker

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-country-picker/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-country-picker</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-country-picker/
implementation 'org.webjars.bower:angular-country-picker:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-country-picker/
implementation ("org.webjars.bower:angular-country-picker:2.0.1")
'org.webjars.bower:angular-country-picker:jar:2.0.1'
<dependency org="org.webjars.bower" name="angular-country-picker" rev="2.0.1">
  <artifact name="angular-country-picker" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-country-picker', version='2.0.1')
)
libraryDependencies += "org.webjars.bower" % "angular-country-picker" % "2.0.1"
[org.webjars.bower/angular-country-picker "2.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1.3.10,2)

Модули Проекта

Данный проект не имеет модулей.

angular-country-picker

AngularJS directive to generate a list of countries as options of the select element.

Installation

You can install the directive using Bower:

$ bower install angular-country-picker

Or npm:

$ npm install angular-country-picker

Then you have to include it in your HTML:

<script src="bower_components/angular-country-picker/country-picker.js"></script>
<script src="node_modules/angular-country-picker/country-picker.js"></script>

And inject the module puigcerber.countryPicker as a dependency of your application:

angular.module('webApp', ['puigcerber.countryPicker']);

Usage

The directive is intended to be used as an attribute of the native select directive setting its ngOptions. Therefore ngModel is required for this to work.

<select ng-model="selectedCountry" pvp-country-picker></select>

Excluding ngOptions, any other optional attribute of the select directive could still be used.

<select name="country" ng-model="selectedCountry" pvp-country-picker ng-change="onChange()" required></select>

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:

<select ng-model="selectedCountry" pvp-country-picker="name"></select>

Config

The country provider can be configured to set a custom list of countries.

angular.module('webApp', ['puigcerber.countryPicker'])
  .config(function(pvpCountriesProvider) {
    pvpCountriesProvider.setCountries([
      { name: 'Abkhazia', alpha2: 'AB'},
      { name: 'Kosovo', alpha2: 'XK'},
      { name: 'Nagorno-Karabakh', alpha2: 'NK'},
      { name: 'Northern Cyprus', alpha2: 'KK'},
      { name: 'Somaliland', alpha2: 'JS'},
      { name: 'South Ossetia', alpha2: 'XI'},
      { name: 'Transnistria', alpha2: 'PF'}
    ]);
  });

See also

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.

License

MIT © Pablo Villoslada Puigcerber

Версии библиотеки

Версия
2.0.1
1.1.1