Angular library to mask input fields using a pattern.
Run ng serve
for a dev server with an example. Navigate to http://localhost:4200/
.
npm install ng-pattern-mask
import {NgPatternMaskModule} from 'ng-pattern-mask';
@NgModule({
imports: [
NgPatternMaskModule,
...
],
...
}) {...}
<!-- directive -->
<input
ngPatternMask
ngpmPattern="dd.MM.yyyy"
placeholder="dd.MM.yyyy"
ngpmDigitPlaceholders="dDmMyYhH09" <!-- OPTIONAL default = "dDmMyYhH09" -->
ngpmCharPlaceholders="_" <!-- OPTIONAL default = "_" -->
/>