1.0.1 • Published 6 years ago

vp-ngx-phone-mask v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

NgxPhoneMask

Angular directive for autoformatting international phone numbers.

Usage

Install via npm:

npm install ngx-phone-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 valueType to 'clean', 'raw' or 'full' to change output format. Default is 'clean'.

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

Contribution

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

To publish:

git commit
npm version patch
npm run build
npm publish dist