This Angular module provides a service and a component to show a country picker with localizable names.
To install this library, run:
$ npm install ngx-country-picker --save
Add the CountryPickerModule
to your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { CountryPickerModule } from 'ngx-country-picker';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Import here
CountryPickerModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once CountryPicker is imported, you can use the component in your Angular application:
<!-- You can now use your library component in app.component.html -->
<h1>
{{title}}
</h1>
<country-picker [flag]="false" [setValue]="cca3" [setName]="name.common"></country-picker>
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ npm run build
To lint all *.ts
files:
$ npm run lint
MIT © Guillaume RODRIGUEZ