1.0.1 • Published 6 years ago

ionic-input-mask v1.0.1

Weekly downloads
115
License
MIT
Repository
github
Last release
6 years ago

ionic-input-mask

Input mask for Ionic2 and upper versions.

Getting Started

Installing

npm install ionic-input-mask --save

Using

# app.module.ts
import { InputMaskModule } from 'ionic-input-mask';
imports: [
    InputMaskModule,
]
# *.html
<input-mask mask="+32 (0) 4__/__.__.__" allowedChars="0-9" type="tel" maskCharacter="_" tabindex="100"></input-mask>

mask

Mandatory
Definition of the mask. maskCharacter (default = '_') will define the maximum length of the field and which characters will be replaced in the mask. Mask is not included in the return value, only input typed by the user.

maskCharacter

Optional
Define which character in the mask should be replaced.
Default value is '_'.

allowedChars

Optional
Define which characters are allowed in the field. Must be character range like in regular expression.
Ex:

  • 0-9 -> Numbers only
  • A-Z -> Letters only, in uppercase

If not defined, all characters are allowed.

tabindex

Optional
Directly linked to ion-input field tabindex.

type

Optional
Directly linked to ion-input field type.