ngx-input-numeric
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

NgxNumericInput

This library was generated with Angular CLI version 15.0.0.

How to use it:

  1. import NgxNumericInput module inside the desrired moduel for example AppModule.ts
  2. import { NgxNumericInputModule } from 'ngx-input-numeric';
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    
    import { AppComponent } from './app.component';
    
    @NgModule({
      declarations: [AppComponent],
      imports: [BrowserModule, NgxNumericInputModule],
      providers: [],
      bootstrap: [AppComponent],
    })
    export class AppModule {}
    
    

3.Inside the template file:

<div>
  <ngx-input-numeric
    [dir]="'rtl'"
    (output)="getData($event)"
    [isRequired]="true"
  ></ngx-input-numeric>
</div>

Inputs

name type dsescription
isRequired boolean making input required.
value string default value for input.
placeholder string placeholder.
dir string 'rtl' or 'ltr'
errorMessage string errorMessage to show in required state.
hasPlaceholder boolean To disable or enable placeholder.
reset() method An api to reset input.

Outputs

name type description
output event get the value of input.

How to reset:

<ngx-input-numeric
    [dir]="'rtl'"
    (output)="getData($event)"
    [isRequired]="true"
    [hasPlaceholder]="false"
    #temp
  ></ngx-input-numeric>

inside .ts file:

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent {
  title = 'numeric-input';
  @ViewChild('temp') input!: NgxNumericInputComponent;
  getData(event: string) {}

  resetForm() {
    this.input.reset();
  }

Package Sidebar

Install

npm i ngx-input-numeric

Weekly Downloads

0

Version

3.0.0

License

none

Unpacked Size

63.3 kB

Total Files

24

Last publish

Collaborators

  • babakbhd