npm.io
0.20.5 • Published 9 years ago

ionic3-input-mask

Licence
CC0-1.0
Version
0.20.5
Deps
6
Vulns
21
Weekly
0
DeprecatedThis package is deprecated

Ionic 3 Input Mask

Getting started

First, install it.

npm i inoic3-input-mask --save

Then, require it and use it:

import {Component} from '@angular/core';
import {Directive} from 'inoic3-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/]
}

Keywords