14.0.0 • Published 2 years ago

ngx-flag-picker v14.0.0

Weekly downloads
326
License
MIT
Repository
github
Last release
2 years ago

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:

NameType
selectedCountryCodestring
countryCodesstring[]
customLabelsRecord\<string, string>
showFlagsboolean
showLabelsboolean
showArrowboolean

Output parameters:

NameType
changedCountryCodeEventEmitter\

Demo

14.0.0

2 years ago

13.0.0

2 years ago

12.0.0

2 years ago

11.1.1

3 years ago

11.0.0

3 years ago

11.1.0

3 years ago

10.0.0

4 years ago

9.0.0

4 years ago

8.0.0

5 years ago