la-input-mask
v0.1.1
Published
A simple alternative to mask numeric (non-numerical comming soon!) inputs on angular.
Downloads
48
Maintainers
Readme
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