NgCpf Validator & Mask
With NgCpf you'll be able to validate and format inputs that receives the Brazilian CPF.
This Angular module support angular versions >= 2 and also compatible with Ionic ion-input
.
Setup
First, install the module:
npm i --save ngcpf
Then, import to your @NgModule
:
;; @ {}
Usage
Now, you will be able to use in your components:
@ public myModel = '';
Notes
Some useful information:
- You can use the validator with
<input>
,<md-input>
,<ion-input>
; - The mask directive will only works with input of type
text
andtel
; - To use the mask directive you don't need to pass any pattern, just use
cpfMask
;
Issues are wellcome!