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
- Host: GitHub
- URL: https://github.com/tiaguinho/ionic2-mask-directive
- Owner: tiaguinho
- License: mit
- Created: 2017-08-15T22:46:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-31T07:13:48.000Z (about 7 years ago)
- Last Synced: 2025-03-17T21:42:36.844Z (about 1 month ago)
- Topics: angular4, directive, ion-input, ionic2, ionic3, mask, maskedinput
- Language: TypeScript
- Size: 39.1 KB
- Stars: 23
- Watchers: 3
- Forks: 11
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)