Library helps you to prevent users from writing or pasting values in inputs, that you don't want to allow. You can pass regular expression to your inputs "mask" attribute, and the things will be managed by itself.
npm install --save ngx-mask-input
yarn add ngx-mask-input
app.module.ts
import { NgModule } from '@angular/core';
import { NgxMaskInputModule } from 'ngx-mask-input';
import { AppComponent } from './app.component';
@NgModule({
declarations: [ AppComponent ],
imports: [ NgxMaskInputModule ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
app.component.html
<!-- Allow only numbers -->
<input type="text" mask="[0-9]">
<!-- Allow only lowercase letters -->
<input type="text" mask="[a-z]">
<!-- Allow only latin letters, numbers and underscore -->
<input type="text" mask="[a-zA-Z0-9_]">
Please see Changelog Page for more information what has changed recently.
Please see CONTRIBUTING.md for details.
To submit an issue correctly, please follow instructions
If you have an idea, and you want to request feature, then read this one
To crearte new pull request and add your piece of work in our project, go through this steps
The MIT License (MIT). Please see License file for more information.