ng-only-digit-mask
v0.0.8
Published
Downloads
8
Maintainers
Readme
NgOnlyDigitDirective
Installation
To install this library, run:
$ npm install ng-only-digit-mask --save
Consuming your library
Once you have installed it you can import NgOnlyDigitMaskModule
from ng-only-digit-mask
in any application module. E.g.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { NgOnlyDigitMaskModule } from 'ng-only-digit-mask';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// NgOnlyDigitMaskModule module
NgOnlyDigitMaskModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Once it is imported, you can use attribute ngNgOnlyDigitMask:
<input ngNgOnlyDigitMask [kmAllowDigitsOnly]="true">
Attributes/Options:
kmAllowDigitsOnly: Indicates whether it's allow only digits or not
kmAllowFloat: Indicates whether it's allow float numbers or not
kmAllowPlus: Indicates whether it's allow start with '+' or not