1.2.12 • Published 1 year ago

country-code-picker v1.2.12

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

country-code-picker

A library for Country code picker field

Live example

Getting started

Step 1: Install angular material:

NPM
ng add @angular/material

Step 2: Install country-code-picker:

NPM
npm install country-code-picker

Step 3: Import the CountryCodePickerComponent

popup.component.ts

import { CountryCodePickerComponent } from "country-code-picker";

@Component({
  selector: "app-popup",
  standalone: true,
  imports: [RouterOutlet, CountryCodePickerComponent],
  templateUrl: "./popup.component.html",
  styleUrl: "./popup.component.scss",
})
export class AppComponent {
  actionSelectEvent(event: Event) {
    console.log(event);
  }
}

Step 4: implement in html

popup.component.html

<country-code-picker displayValue="dial_code" defaultValue="+91" placeHolder="search" backgroundColor="#ffffff" borderColor="#000000" (actionSelectEvent)="actionSelectEvent($event)"></country-code-picker>

Step 5: download and add flags folder in your assets that you can find in my repo

  • download the zip and extract open and get flags folder add it in your assets folder

Step 6: still flag image is not showing please restart the server

API

Inputs

InputTypeDefaultAllowed ValuesRequiredDescription
displayValuestringdial_codedial_code/code/flagnodisplay value that display in select field
defaultValuestring+91+91/INnodefault value to be selected
placeHolderstringdial_codeany textnoplaceholder to display in search input
backgroundColorstring#ffffffhex codesnocolor to add in background to selection field
borderColorstring#000000hex codesnocolor to add in border to selection field

Outputs

OutputDescription
actionSelectEventevent will called when an country code is selected

Changelogs

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

0.0.0-watch

1 year ago

0.0.0

1 year ago