Simple input mask for Ionic2
Usage:
import {DirectivesModule} from "../directives/directives.module";
Page html:
<ion-input [(ngModel)]="username" type="tel" [mask-input]="{mask: phoneMask}"></ion-input>
Page class:
phoneMask = ['+', '7', '(', /\d/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, '-', /\d/, /\d/];