3.0.0 • Published 1 year ago

ngx-input-numeric v3.0.0

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

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

nametypedsescription
isRequiredbooleanmaking input required.
valuestringdefault value for input.
placeholderstringplaceholder.
dirstring'rtl' or 'ltr'
errorMessagestringerrorMessage to show in required state.
hasPlaceholderbooleanTo disable or enable placeholder.
reset()methodAn api to reset input.

Outputs

nametypedescription
outputeventget 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();
  }
3.0.0

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago