0.18.6 • Published 8 years ago

ionic2-input-mask v0.18.6

Weekly downloads
15
License
CC0-1.0
Repository
github
Last release
8 years ago

Ionic 2 Input Mask

Getting started

First, install it.

npm i ionic2-input-mask --save

Then, require it and use it:

import {Component} from '@angular/core';
import {Directive} from 'ionic2-text-mask'

@Component({
  selector: 'app',
  template: `
    <ion-input [textMask]="{mask: mask}" [(ngModel)]="myModel"/>
  `,
  directives: [Directive]
})
export class SomeComponent {
  public myModel = ''
  public mask = ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/]
}