Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-i18n-country-select

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-i18n-country-select

> Angular wrapper for [i18n-iso-countries](https://github.com/michaelwittig/node-i18n-iso-countries).

  • 2.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 22 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc