0.2.4 • Published 6 years ago

ng-digits v0.2.4

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

NgDigits

This package make sure avoiding non-digits character for input. NgDigits also support maximum digits and Japanese input.

Browsers support

IE / EdgeFirefoxChromeSafariiOS SafariOpera
IE11, Edgelast 3 versionslast 3 versionslast 3 versionslast 2 versionslast 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.

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago