Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@ngodings/ngx-country

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngodings/ngx-country

Simple get all country, get country by code/abbreviation, get code by country, get bbreviation by country & easy use pipe in Angular

latest
Source
npmnpm
Version
15.0.9
Version published
Maintainers
1
Created
Source

@ngodings/ngx-country

Simple get all country, get country by code/abbreviation, get code by country, get bbreviation by country & easy use pipe in Angular

Demo - Angular v15

https://npm.ngodings.com/packages/ngx-country

Support Me

If you like this package I will be happy that you support me on Buy me a coffee :)
Buy me coffee: https://www.buymeacoffee.com/alidihaw
Indonesia People: https://sociabuzz.com/dihaw

Getting Started

Installing and Importing

Install the package by command:

 npm install @ngodings/ngx-country --save

Import the module

import { NgxCountryModule, CountryService } from "@ngodings/ngx-country";

@NgModule({
    imports: [
        ...
        NgxCountryModule
    ],
    declarations: [...],
    providers: [
        ...
        CountryService
    ]
})
export class AppModule {}

Usage

Import the service

constructor(private countryService: CountryService,) {}

Get All Countries

await this.countryService.getCountries();

Get All Country Codes

await this.countryService.getCountryCodes();

Get Abbreviation By Country

await this.countryService.getAbbreviationByCountry('Singapore');

Get Code By Country

await this.countryService.getCodeByCountry('Singapore');

Get Country By Code

await this.countryService.getCountryByCode('+65');

Get Country By Abbreviation

await this.countryService.getCountryByAbbreviation('SG');

Get Country By Abbreviation - Pipe

{{ 'SG'| countryByAbbreviationPipe | async }}

Get Abbreviation By Country - Pipe

{{ 'Singapore'| abbreviationByCountryPipe | async }}

Get Country By Code - Pipe

{{ '+65'| countryByCodePipe | async }}

Get Code By Country - Pipe

{{ 'Singapore'| codeByCountryPipe | async }}

Development

Prepare your environment

  • Install Node.js and NPM
  • Install local dev dependencies: npm install while current directory is this repo

License

MIT @ Ali Abdul Wahid

Keywords

ngx

FAQs

Package last updated on 27 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts