This is a simple Angular numeric input component with buttons to increase and decrease the numeric value.
npm install ngx-numeric-inputnpm install ngx-numeric-input --save
1. Import the NumericInputModule:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { NumericInputModule } from 'ngx-numeric-input';
@NgModule({
imports: [
BrowserModule,
NumericInputModule,
],
bootstrap: [AppComponent]
})
export class AppModule { }
2. Use the `ngx-numeric-input component in your templates:
- min: Minimal number that can be selected
- max: Maximal number that can be selected
- disabled`: Indicates whether the value can be changed