Lib is deprecated
We're sorry, but we'll focus only on one library
brmasker4
return custom mask in input for angular 4
Required
- node v8.4.0 or up
- npm 5.4.2 or up
- @angular/cli: 1.4.4
install
npm install brmasker4 --save
HTML
correct usage
Module
; @
Features
; ... {} ... protected : FormGroup return phone: this ; private : string const config: BrMaskModel = ; configphone = true; return thisbrMaskerDirective;
Inputs
- brmasker: BrModel
BrModel = mask: string; len: number; money: boolean; phone: boolean; person: boolean;
Name | type | info |
---|---|---|
mask | string | Optional |
len | string | Optional |
money | boolean | Optional |
decimal | number | Optional for 'money', default '2' |
phone | boolean | Optional |
person | boolean | Optional |
percent | boolean | Optional |
type | string | Optional default 'all' |
999.999.999-99
/ 99.999.999/9999-99
Exemple for CPF/CNPJ usage
999,99
Exemple for Real usage
(99) 9999-9999
/ (99) 99999-9999
Exemple for Phone usage
Characters
- . / ( ) , * + @ # $ & %
Guide
[brmasker]="{mask:'000.000.000-00', len:14}"
[brmasker] = component receive array (mask, len)
mask --> required / default = '' / custom mask
len --> required / default = 0 / number of length
data
[brmasker]="{mask:'00/00/0000', len:10}"
cep
[brmasker]="{mask:'00.000-000', len:10}"
custom cpf
[brmasker]="{mask:'000.000.000-00', len:14}"
custom cnpj
[brmasker]="{mask:'00.000.000/0000-00', len:18}"
custom telefone
[brmasker]="{mask:'(00) 0000-0000', len:14}"
custom whatsapp
[brmasker]="{mask:'(00) 00000-0000', len:15}"
Build for developer
Only use if you change the component
Build
npm run build
Publish
npm publish
Versions
-
for angular 6 using version 1.0.2
-
for angular 5 using version 1.0.1
Changelog
v1.0.2
-
support for angular 6
-
news updates
v1.0.1
- fix number in person and phone
v1.0.0
- Suport reactive form
v0.0.29
- custom phone, money and person mask