This package make sure avoiding non-digits character for input. NgDigits also support maximum digits and Japanese input.
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 |
npm install ng-digits --save
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 { }
<input appDigits type="text" name="text" id="text"/>
<input [appDigits]="[]" type="text" name="text" id="text"/>
<input [appDigits]="['1.2']" type="text" name="text" id="text"/>
<input [appDigits]="['1.3']" maxDigits="5" type="text" name="text" id="text"/>
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Amir Movahedi
- See also the list of contributors who participated in this project.
- Fork || Star
This project is licensed under the MIT License - see the LICENSE file for details.
Originally made for @DefideInc by @De-Amir.