Angular UI Components Documentation
The Angular NumberInput enables users to input numbers. This guide adds the Angular NumberInput (jqxNumberInput) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxnumberinput 
In an Angular project (to start one, see Getting started with Angular), add the package with the Angular CLI. It asks for a theme and adds the styles to angular.json:
ng add jqwidgets-ng
Components are standalone: add jqxNumberInputModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxNumberInputModule } from 'jqwidgets-ng/jqxnumberinput';
@Component({
selector: 'app-root',
imports: [jqxNumberInputModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<div style="margin-top: 10px;">
Number
</div>
<jqxNumberInput #numericInput
[width]="250" [height]="25" [spinButtons]="true">
</jqxNumberInput>
<div style="margin-top: 10px;">
Percentage
</div>
<jqxNumberInput #percentageInput
[width]="250" [height]="25" [symbolPosition]="'right'"
[symbol]="'%'" [spinButtons]="true" [digits]="3">
</jqxNumberInput>
<div style="margin-top: 10px;">
Currency
</div>
<jqxNumberInput #currencyInput
[width]="250" [height]="25" [symbol]="'$'" [spinButtons]="true">
</jqxNumberInput>
<div style="margin-top: 10px;">
Disabled
</div>
<jqxNumberInput #disabledInput
[width]="250" [height]="25" [disabled]="true" [spinButtons]="true">
</jqxNumberInput>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { jqxNumberInputModule } from 'jqwidgets-ng/jqxnumberinput';
@Component({
imports: [CommonModule, FormsModule, jqxNumberInputModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, change: This event is triggered when the value is changed and the control's focus is lost.
<jqxNumberInput (onChange)="onChange($event)"></jqxNumberInput>
onChange(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, val: Sets or gets the value.
<jqxNumberInput #myNumberInput></jqxNumberInput>
import { Component, viewChild } from '@angular/core';
import { jqxNumberInputModule, jqxNumberInputComponent } from 'jqwidgets-ng/jqxnumberinput';
@Component({
selector: 'app-root',
imports: [jqxNumberInputModule],
templateUrl: './app.html'
})
export class App {
readonly myNumberInput = viewChild.required<jqxNumberInputComponent>('myNumberInput');
run(): void {
const value = this.myNumberInput().val();
console.log(value);
}
}