vp-ngx-phone-mask
v1.0.1
Published
Angular directive for autoformatting international phone numbers.
Downloads
3
Maintainers
Readme
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