directive for mask ion-input on ionic2
npm install ionic2-mask-directiveIonic2MaskDirective help you add mask on ion-input with just a directive and a very simple configuration.
``bash`
npm i ionic2-mask-directive --save
Import the directive into your app module.
`typescript
import {Ionic2MaskDirective} from "ionic2-mask-directive";
@NgModule({
declarations: [
MyApp,
Ionic2MaskDirective,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
HttpModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {
}
`
To configure the mask, you can use 3 types of characters.
* \# - any type of char;
* 9 - only numbers;
* A - only letters;
`html``
Any pull-request and issue is more than welcome.