Angular UI Components Documentation
The Angular Knob is a rotary knob with custom dials, markers and pointers. This guide adds the Angular Knob (jqxKnob) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxknob 
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 jqxKnobModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxKnobModule } from 'jqwidgets-ng/jqxknob';
@Component({
selector: 'app-root',
imports: [jqxKnobModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<div id="container">
<jqxKnob #myKnob (onChange)="onChange($event)"
[value]="60" [min]="0" [max]="100" [startAngle]="120"
[endAngle]="420" [snapToStep]="true" [rotation]="'clockwise'" [style]="style"
[marks]="marks" [labels]="labels" [progressBar]="progressBar" [pointer]="pointer">
</jqxKnob>
<div id="inputField">
<jqxNumberInput #myNumberInput
(mousedown)="onMouseDown($event)" (keyup)="onKeyup()" (onValueChanged)="onValueChanged()"
[width]="60" [height]="40" [decimal]="60" [min]="0" [max]="100"
[textAlign]="'center'" [decimalDigits]="1" [inputMode]="'simple'">
</jqxNumberInput>
</div>
</div>
import { Component, ViewEncapsulation, viewChild } from '@angular/core';
import { jqxKnobComponent } from 'jqwidgets-ng/jqxknob';
import { jqxNumberInputComponent } from 'jqwidgets-ng/jqxnumberinput';
import { CommonModule } from '@angular/common';
import { jqxKnobModule } from 'jqwidgets-ng/jqxknob';
import { jqxNumberInputModule } from 'jqwidgets-ng/jqxnumberinput';
@Component({
imports: [CommonModule, jqxKnobModule, jqxNumberInputModule],
selector: 'app-root',
templateUrl: './app.html',
styleUrl: './app.css',
encapsulation: ViewEncapsulation.None
})
export class App {
readonly myKnob = viewChild.required<jqxKnobComponent>('myKnob');
readonly myNumberInput = viewChild.required<jqxNumberInputComponent>('myNumberInput');
style: any = {
stroke: '#dfe3e9',
strokeWidth: 3,
fill: {
color: '#fefefe',
gradientType: 'linear',
gradientStops: [
[0, 1],
[50, 0.9],
[100, 1]
]
}
};
marks: any = {
colorRemaining: { color: 'grey', border: 'grey' },
colorProgress: { color: '#00a4e1', border: '#00a4e1' },
type: 'line',
offset: '71%',
thickness: 3,
size: '6%',
majorSize: '9%',
majorInterval: 10,
minorInterval: 2
};
labels: any = { offset: '88%', step: 10, visible: true };
progressBar: any = {
style: { fill: '#00a4e1', stroke: 'grey' },
size: '9%',
offset: '60%',
background: { fill: 'grey', stroke: 'grey' }
};
pointer: any = {
type: 'arrow',
style: { fill: '#00a4e1', stroke: 'grey' },
size: '59%',
offset: '49%',
thickness: 20
};
onChange(event: any): void {
if (event.args.changeSource == 'propertyChange' || event.args.changeSource == 'val') {
return;
}
this.myNumberInput().val(event.args.value);
}
onMouseDown(event: any): void {
event.stopPropagation();
}
onKeyup(): void {
let val = this.myNumberInput().val();
this.myKnob().val(val);
}
onValueChanged(): void {
let val = this.myNumberInput().val();
this.myKnob().val(val);
}
}#container {
position: relative;
}
#inputField jqxNumberInput > div {
left: 170px;
top: 323px;
position: absolute;
background: transparent !important;
border: none !important;
}
text.jqx-knob-label {
font-size: 20px;
}
jqxNumberInput > div > input {
background: transparent !important;
font-size: 20px !important;
color: grey !important;
}
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.
<jqxKnob (onChange)="onChange($event)"></jqxKnob>
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.
<jqxKnob #myKnob></jqxKnob>
import { Component, viewChild } from '@angular/core';
import { jqxKnobModule, jqxKnobComponent } from 'jqwidgets-ng/jqxknob';
@Component({
selector: 'app-root',
imports: [jqxKnobModule],
templateUrl: './app.html'
})
export class App {
readonly myKnob = viewChild.required<jqxKnobComponent>('myKnob');
run(): void {
const value = this.myKnob().val();
console.log(value);
}
}