Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-phone-mask

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-phone-mask

Angular directive for autoformatting phone numbers. Compatible with Angular 7. Currently doesn't support phone numbers with lengths other than 11. (`+7 (987) 123-45-67`)

  • 3.0.0
  • npm
  • Socket score

Version published
Weekly downloads
77
decreased by-18.09%
Maintainers
1
Weekly downloads
 
Created
Source

NgxPhoneMask pipeline status

Angular directive for autoformatting phone numbers. Compatible with Angular 7. Currently doesn't support phone numbers with lengths other than 11. (+7 (987) 123-45-67)

Demo

Usage

This libs rely on text-mask, so you need to install it.

Install via npm:

npm install ngx-phone-mask angular2-text-mask

or yarn:

yarn add ngx-phone-mask angular2-text-mask

Import in your app.module.ts:

import { NgxPhoneMaskModule } from 'ngx-phone-mask';

@NgModule({
  imports: [
    NgxPhoneMaskModule
  ]
})

Use it:

<input ngxPhoneMask [(ngModel)]='yourModelName'>
or
<input ngxPhoneMask [formControl]='yourControl'>
or
<input ngxPhoneMask formControlName='yourControlName'>

Config

You can set clean to false if you want formatted value in model.

<input ngxPhoneMask [(ngModel)]='yourModelName' valueType='full'>

Contribution

This component is under development. Pull requests and issues (PR's better) are welcome.

Contributing

Please feel free to leave your PRs, issues, feature requests.

Upcoming features

  • Support other phone lengths
  • Return country when recognized
  • Tests

FAQs

Package last updated on 11 Nov 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc