Skip to content

amandachagas/br-masker-ionic-3

 
 

Repository files navigation

brmasker-ionic

GitHub issues GitHub stars GitHub forks GitHub license Build Status

return custom mask in input for ionic 3

Required

  • node v8.2.1 or up
  • npm 5.3.0 or up
  • ionic 3.9.2

install

npm install brmasker-ionic-3 --save

HTML

correct usage

<ion-item>
	<ion-input type="text" name="cpf" placeholder="CPF" [brmasker]="{mask:'000.000.000-00', len:14}"></ion-input>
</ion-item>

usage in input

<input type="text" name="cpf" placeholder="CPF" [brmasker]="{mask:'000.000.000-00', len:14}" value="">

Module

import { BrMaskerModule } from 'brmasker-ionic-3';

@NgModule({
  imports: [
    BrMaskerModule
  ],
})

Characters

- . / ( ) , * + @ # R$ $ & %

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}"

cpf

[brmasker]="{mask:'000.000.000-00', len:14}"

cnpj

[brmasker]="{mask:'00.000.000/0000-00', len:18}"

telefone

[brmasker]="{mask:'(00) 0000-0000', len:14}"

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

About

mascara para inputs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 90.4%
  • JavaScript 9.6%