An open API service indexing awesome lists of open source software.

https://github.com/tiaguinho/ionic2-mask-directive

directive to mask ion-input
https://github.com/tiaguinho/ionic2-mask-directive

angular4 directive ion-input ionic2 ionic3 mask maskedinput

Last synced: about 1 month ago
JSON representation

directive to mask ion-input

Awesome Lists containing this project

README

        

# ionic2-mask-directive

Ionic2MaskDirective help you add mask on ion-input with just a directive and a very simple configuration.

## Install

```bash
npm i ionic2-mask-directive --save
```

## Import directive

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 {
}
```

## Usage

To configure the mask, you can use 3 types of characters.

* \# - any type of char;
* 9 - only numbers;
* A - only letters;

## Example

```html

```

## Contribute

Any pull-request and issue is more than welcome.

## License

[The MIT License (MIT) Copyright (c) 2013](http://opensource.org/licenses/MIT)