All Projects → tiaguinho → ionic2-mask-directive

tiaguinho / ionic2-mask-directive

Licence: MIT License
directive to mask ion-input

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to ionic2-mask-directive

Ion2 Calendar
📅 A date picker components for ionic2 /ionic3 / ionic4
Stars: ✭ 537 (+2137.5%)
Mutual labels:  angular4, ionic2, ionic3
Chihu2
ionic2-example <吃乎2>混合开发-美食app 🍜 ☕️ 🍦 (This is a support android and apple ionic2 case, a food app)
Stars: ✭ 124 (+416.67%)
Mutual labels:  angular4, ionic2, ionic3
Drip Ionic3
「水滴打卡」App Open Source Code Base On Ionic V3 Framework
Stars: ✭ 74 (+208.33%)
Mutual labels:  angular4, ionic2, ionic3
Ionic Audio
An audio player for Ionic 3 and Angular 4. Works with HTML 5 audio or native audio using Cordova Media plugin.
Stars: ✭ 332 (+1283.33%)
Mutual labels:  angular4, ionic2, ionic3
Wooionic3
An eCommerce App for WooCommerce stores using Ionic 3.
Stars: ✭ 208 (+766.67%)
Mutual labels:  angular4, ionic2, ionic3
Ionic2 Cnodeclub
基于Ionci 3.4.2、Angular 4、TypeScript 2.3的APP
Stars: ✭ 116 (+383.33%)
Mutual labels:  angular4, ionic2, ionic3
ionic-uuchat
基于ionic3,angular4的实时聊天app,兼容web端。该项目只是前端部分,所有数据需要请求后端服务器,需要配套express-uuchat-api使用。
Stars: ✭ 14 (-41.67%)
Mutual labels:  angular4, ionic2, ionic3
Ionic3 Components
A project full of ionic 3 components and samples - to make life easier :)
Stars: ✭ 1,689 (+6937.5%)
Mutual labels:  angular4, ionic2, ionic3
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (+8.33%)
Mutual labels:  angular4, ionic2, ionic3
Ionic2 Pokedex
🎮 Pokédex sample app developed with Ionic 2, Angular 2 and Apache Cordova. Using Pokéapi as source for data.
Stars: ✭ 143 (+495.83%)
Mutual labels:  angular4, ionic2, ionic3
ionic3-image-handling
In this ionic tutorial you will learn how to access the image gallery and take pictures from an ionic app. Also we will show you how to add a image cropper. This ionic tutorial includes a working ionic app example you can reuse for your needs.
Stars: ✭ 35 (+45.83%)
Mutual labels:  angular4, ionic2, ionic3
Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (-45.83%)
Mutual labels:  angular4, ionic2, ionic3
ionic-modal-custom-transitions
Add Custom Transitions to Ionic Modals.
Stars: ✭ 22 (-8.33%)
Mutual labels:  angular4, ionic2, ionic3
ionic-app-with-aws-cognito
Angular 4, Ionic 3, and AWS (Amazon) Cognito User Pools. Authentication out of the box.
Stars: ✭ 62 (+158.33%)
Mutual labels:  angular4, ionic3
birdchain-mvp
Decentralized application (Dapp) similar to instant messenger. The BIG difference is that it will allow its users to make a monthly passive income, while providing companies with higher quality and better-priced services.
Stars: ✭ 25 (+4.17%)
Mutual labels:  angular4, ionic2
ionic3-awesome
😃 ionic3自定义组件及常用例子 演示地址
Stars: ✭ 95 (+295.83%)
Mutual labels:  ionic2, ionic3
ionic-workflow-guide
Create a full and powerful worflow with Ionic (Unit Testing, Environment variables, Automatic documentation, Production App Server, Automatic deployment)
Stars: ✭ 46 (+91.67%)
Mutual labels:  ionic2, ionic3
ionicfirebasecrud
An example of crud with Firebase and Ionic
Stars: ✭ 15 (-37.5%)
Mutual labels:  ionic2, ionic3
ionicfirebaseauth
Exemplo de alguns tipos de autenticação com Ionic 2 e Firebase
Stars: ✭ 18 (-25%)
Mutual labels:  ionic2, ionic3
ngx-konami
A simple directive to add easter eggs in your Angular application 👾
Stars: ✭ 34 (+41.67%)
Mutual labels:  directive, angular4

ionic2-mask-directive

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

Install

npm i ionic2-mask-directive --save

Import directive

Import the directive into your app module.

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

<!-- phone number in Brasil -->
<ion-input type="text" mask="(99) 9999-9999" placeholder="Phone" [(ngModel)]="user.phone" required></ion-input>
<!-- brasilian document -->
<ion-input type="text" mask="999.999.999-99" placeholder="CPF" [(ngModel)]="user.document" required></ion-input>

Contribute

Any pull-request and issue is more than welcome.

License

The MIT License (MIT) Copyright (c) 2013

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].