Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

This package has been deprecated

Author message:

move to https://github.com/amarkes/br-masker-ionic-3

brmasker-ionic

1.0.12 • Public • Published

brmasker-ionic

GitHub issues GitHub stars GitHub forks GitHub license Build Status

return custom mask in input for ionic 2

Required

  • node 7.7.3 or up
  • npm 4.1.2 or up
  • ionic 2.2.1

install

npm install brmasker-ionic --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 { AppMaskerModule } from 'brmasker-ionic';
 
@NgModule({
  imports: [
    AppMaskerModule
  ],
})
 

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

remove files before build

dist/
src/app/app.module.ngfactory.ts
src/app/app.module.ngsummary.json
src/app/index.ngsummary.json
src/app/components/index.ngsummary.json
src/app/components/masker/index.ngsummary.json
src/app/components/masker/masker.component.ngfactory.ts
src/app/components/masker/masker.component.ngsummary.json
src/app/components/masker/masker.module.ngfactory.ts
src/app/components/masker/masker.module.ngsummary.json
npm run build

Install

npm i brmasker-ionic

DownloadsWeekly Downloads

16

Version

1.0.12

License

MIT

Last publish

Collaborators

  • avatar