ngx-flag-picker

14.0.0 • Public • Published

How to use

Add a link tag with flag-icon-css library to your index.html file.

Add NgxFlagPickerModule to your module in the import section.

After:

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <ngx-flag-picker
      [selectedCountryCode]="selectedCountryCode"
      [countryCodes]="countryCodes"
      (changedCountryCode)="changeSelectedCountryCode($event)">
    </ngx-flag-picker>
    <h1>{{ selectedCountryCode }}</h1>
  `
})
export class AppComponent {
  selectedCountryCode = 'us';
  countryCodes = ['us', 'lu', 'de', 'bs', 'br', 'pt'];

  changeSelectedCountryCode(value: string): void {
    this.selectedCountryCode = value;
  }
}

Input parameters:

Name Type
selectedCountryCode string
countryCodes string[]
customLabels Record<string, string>
showFlags boolean
showLabels boolean
showArrow boolean

Output parameters:

Name Type
changedCountryCode EventEmitter<string>

Demo

Package Sidebar

Install

npm i ngx-flag-picker

Weekly Downloads

423

Version

14.0.0

License

MIT

Unpacked Size

10.9 kB

Total Files

15

Last publish

Collaborators

  • temagr