Skip to content

alessiobianchini/ng-pattern-mask

Repository files navigation

NgPatternMask

Angular library to mask input fields using a pattern.


Status

Build and publish library to github registry Build and publish library to npm.js registry

Demo app

Run ng serve for a dev server with an example. Navigate to http://localhost:4200/.

Install

npm install ng-pattern-mask

Configuration

import {NgPatternMaskModule} from 'ng-pattern-mask';

@NgModule({
  imports: [
    NgPatternMaskModule,
    ...
  ],
  ...
}) {...}

Basic usage

<!-- directive -->
<input 
    ngPatternMask
    ngpmPattern="dd.MM.yyyy"
    placeholder="dd.MM.yyyy"
    ngpmDigitPlaceholders="dDmMyYhH09" <!-- OPTIONAL default = "dDmMyYhH09" -->
    ngpmCharPlaceholders="_" <!-- OPTIONAL default = "_" -->
/>