The ComplexInput component for Angular contains an input field with auto-complete functionality and a list of selectable items displayed in a drop-down.
npm install -g @angular/cli ng new jqwidgets-project cd jqwidgets-project
ng add jqwidgets-ng
jQWidgets UI for Angular is distributed as jqwidgets-ng NPM package
npm install jqwidgets-ng
@import 'jqwidgets-ng/jqwidgets/styles/jqx.base.css';
"styles": [ "node_modules/jqwidgets-ng/jqwidgets/styles/jqx.base.css" ]
<jqxComplexInput [theme]="'fluent'" #myComplexInput
[width]="250" [height]="25" [value]="'15 + 7.2i'">
</jqxComplexInput>
<div style="margin-top: 20px;">
<jqxButton [theme]="'fluent'" (onClick)="getRealPart()" [width]="150">
Get real part
</jqxButton>
<jqxButton [theme]="'fluent'" (onClick)="getImaginarypart()" [width]="150">
Get imaginary part
</jqxButton>
</div>
import { Component, ViewChild } from '@angular/core';
import { jqxPanelModule, jqxPanelComponent } from 'jqwidgets-ng/jqxpanel';
import { jqxComplexInputModule, jqxComplexInputComponent } from 'jqwidgets-ng/jqxcomplexinput';
import { jqxButtonComponent, jqxButtonModule } from 'jqwidgets-ng/jqxbuttons';
@Component({
selector: 'app-root',
imports: [jqxComplexInputModule, jqxButtonModule, jqxPanelModule],
standalone: true,
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('myComplexInput') myComplexInput: jqxComplexInputComponent;
getRealPart(): void {
let realPart = this.myComplexInput.getReal();
alert(`Real part is ${realPart}`);
}
getImaginarypart(): void {
let imaginaryPart = this.myComplexInput.getImaginary();
alert(`Imaginary part is ${imaginaryPart}`);
}
}