An Angular Material package for selecting country from list.
Supports:
- Angular
- Angular Material
- ReactiveFormsModule
$ npm install ngx-country-dropdown --save
import { NgxCountryDropdownModule } from "ngx-country-dropdown";
Add NgxCountryDropdownModule
to your module file:
imports: [
NgxCountryDropdownModule,
]
Refer to test app in this repository for working example.
<form action="" [formGroup]="testForm" (submit)="onSubmit()">
<ngx-country-dropdown defaultValue="India" formControlName="country"></ngx-country-dropdown>
<input class="btn" type="submit" value="Show">
</form>
<p> {{ selectedCountry}} </p>
Options | Type | Default | Description |
---|---|---|---|
defaultValue | string |
"" |
Default country value. |
- Fork repo.
- Go to
./projects/ngx-country-dropdown
- Update
./src/lib
with new functionality. - Update README.md
- Pull request.
angular npm countrylist dropdown input