0.1.1 • Published 6 years ago

la-input-mask v0.1.1

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

LA-INPUT-MASK

A simple alternative to mask numeric (non-numerical comming soon!) inputs on angular.

TO-DO

  • add support for non-numerical characters
  • cleanup the project to just the necessary
  • improve the README
  • you tell me!

How to use

Installation

npm install la-input-mask --save

Usage

Import the provided module inside the module you want to use the mask

...
import { LaInputMaskModule } from 'la-input-mask';
...
@NgModule({
  ...
  imports: [
    LaInputMaskModule
  ]
  ...
})
...

Then use the directive on your input

<input type="text" [laMask]="{mask: '99-99', outputMask: true}" [(ngModel)]="value">

Properties

Mask:

the mask that should be displayed

outputMask:

defines if the value output contains the mask elements;

eg. 1 'outputMask: false':

  • inputed value: 11-11
  • outputed value: 1111

eg. 2 'outputMask: true':

  • inputed value: 11-11
  • outputed value: 11-11