JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 213
  • Score
    100M100P100Q83158F
  • License MIT

Package Exports

  • ngx-flag-picker
  • ngx-flag-picker/bundles/ngx-flag-picker.umd.js
  • ngx-flag-picker/fesm2015/ngx-flag-picker.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-flag-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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