0.2.4 • Published 6 years ago
ng-digits v0.2.4
NgDigits
This package make sure avoiding non-digits character for input. NgDigits also support maximum digits and Japanese input.
Browsers support
IE / Edge | Firefox | Chrome | Safari | iOS Safari | Opera |
---|---|---|---|---|---|
IE11, Edge | last 3 versions | last 3 versions | last 3 versions | last 2 versions | last 2 versions |
Install
npm install ng-digits --save
Usage
Import NgDigits Module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {NgDigitsModule} from 'ng-digits';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgDigitsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Integer Number without ,
(eg. 12356)
<input appDigits type="text" name="text" id="text"/>
Integer Number with ,
(eg. 12,356)
<input [appDigits]="[]" type="text" name="text" id="text"/>
Decimal Number (eg. 1,235.62)
<input [appDigits]="['1.2']" type="text" name="text" id="text"/>
Integer Number with maximum digits (eg. 12.356)
<input [appDigits]="['1.3']" maxDigits="5" type="text" name="text" id="text"/>
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Amir Movahedi
- See also the list of contributors who participated in this project.
How To Support
- Fork || Star
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credit
Originally made for @DefideInc by @De-Amir.