2.2.6 • Published 1 year ago

ngx-i18n-country-select v2.2.6

Weekly downloads
17
License
MIT
Repository
github
Last release
1 year ago

ngx-i18n-country-select

Angular wrapper for i18n-iso-countries.

Build Status npm version codecov

Major Todos: Fix testcases & documentation

Installation

npm install i18n-iso-countries --save
npm install ngx-i18n-country-select --save

Integration

// app.module.ts
import { NgModule, LOCALE_ID, APP_INITIALIZER } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { I18nCountrySelectModule, I18nCountrySelectService } from 'ngx-i18n-country-select';

export function setUpI18nCountrySelect(service: I18nCountrySelectService) {
  return () => service.use(['de', 'en']);
}

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, I18nCountrySelectModule.forRoot()],
  providers: [
    { provide: LOCALE_ID, useValue: 'de-DE' },
    I18nCountrySelectService,
    {
      provide: APP_INITIALIZER,
      useFactory: setUpI18nCountrySelect,
      deps: [I18nCountrySelectService],
      multi: true
    }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
// app.component.ts
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html'
})
export class AppComponent {
  item = {
    isocode: 'de'
  };
}
<i18n-country-select [(iso3166Alpha2)]="item.isocode" size="sm"></i18n-country-select>

Documentation

Demo on stackblitz

attributetypedescription
iso3166Alpha2Objectmodel as ISO 3166-1 Alpha2
sizestring'sm', 'lg'. default: nothing.
pleaseChoosestringdefault option label. default: 'Please choose...'.
mandatorybooleanmake select required. default: false
editablebooleanenable or disable select. default: true

Release History

  • v2.2.6
    • angular v15, still missing documentation & tests
  • v2.2.2
  • v2.2.1
    • update @angular/cli, @angular/core to v13. i18n-iso-countries to v7
  • v2.1.0
    • update @angular/cli, @angular/core to v8. i18n-iso-countries to v4
  • v2.0.2
    • add new option mandatory to set required attribute
  • v2.0.0
    • switchted to @angular/cli and ng-packagr, requires @angular/core v7 and i18n-iso-countries v3.7

Rename local master branch to main

git branch -m master main
git fetch origin
git branch -u origin/main main

LICENCE

MIT © Oliver Sahner

2.2.6

1 year ago

2.2.3

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.0-beta.2

2 years ago

2.2.0-beta.3

2 years ago

2.2.0-beta.4

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.0-beta.1

3 years ago

2.1.0

5 years ago

2.0.2

5 years ago

2.0.0

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.1

7 years ago