šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

ngx-p-world-phone-input

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-p-world-phone-input

[![npm version](https://badge.fury.io/js/ngx-p-world-phone-input.svg)](https://badge.fury.io/js/ngx-p-world-phone-input) [![npm](https://img.shields.io/npm/dm/localeval.svg)](https://www.npmjs.com/package/ngx-p-world-phone-input)

16.0.6
latest
Source
npm
Version published
Weekly downloads
33
17.86%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Angular/PrimeNG World Phone Number Input (NgxPWorldPhoneInput)

npm version npm

An Angular package designed to help international phone number inputting in angular applications.It uses PrimeNG (https://primeng.org/) components as base and FlagCDN (https://flagcdn.com/) as flag image provider. It helps validating inputted number as it clears out on invalid input.

image

Version Compatibility

Library/FrameworkAngularPrimeNG
ngx-p-world-phone-input16.2.016.2.0

Installation

Install Command

# npm i ngx-p-world-phone-input

Usage

Importing

Import the WorldPhoneInputModule from this package into your app.module or the desired module

import { WorldPhoneInputModule } from 'ngx-p-world-phone-input';

Use Example

my-component.html

<ngx-world-phone-input 
  [(phone)]="modeledPhone.phone" 
  [(ddi)]="modeledPhone.ddi">
</ngx-world-phone-input>

my-component.ts

modeledPhone: any = {
    ddi: "55",
    phone: 21976905821
  }

Api

Properties

NameTypeDefaultDescription
ddistring"55"The ddi / phone code for the selected country.
phoneanynullThe modeled phone number (without ddi)
languagestring"pt-BR"The language to use (currently supports only pt-BR and en-US)

Events

NameTypeDescription
ddiChangeEventEmitterFires when ddi selection changes
phoneChangeEventEmitterFires when phoneNumber changes

Todo (Future Projects)

  • Enable visual feedback on invalid state
  • Add validation options
  • Add / Remove countries as an option
  • Add support for other languages
  • Add documentation on styling

Library Contributions

  • Fork repo.
  • Update ./projects/ngx-intl-tel-input
  • Build / test library.
  • Update ./src/app with new functionality.
  • Update README.md
  • Pull request.

Special Thanks

FlagCDN for flag package [https://flagcdn.com/]

@Webcat12345 for original idea / inspiration (ngx-int-tel-input)

FAQs

Package last updated on 03 Mar 2024

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