The Rating component for Angular represents a widget that allows you to choose a rating. You can configure the Rating items size, image and the number of displayed items.
npm install -g @angular/cli ng new jqwidgets-project cd jqwidgets-project
ng add jqwidgets-ngAlternatively, you can use the standard installation (Manual Setup)
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" ]
<div id='jqxWidget' style="font-size: 13px; font-family: Verdana;">
<jqxRating #jqxRating
(onChange)="change($event)"
[width]="350"
[height]="35"></jqxRating>
<div style='margin-top: 10px;'>
<div style='float: left;'>Rating: </div><div style='float: left;' #rate></div>
</div>
</div>
import { Component, ViewChild, ElementRef } from '@angular/core';
import { jqxRatingModule, jqxRatingComponent } from 'jqwidgets-ng/jqxrating';
@Component({
selector: 'app-root',
imports: [jqxRatingModule],
standalone: true,
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('rate') rate: ElementRef;
change(event: any): void {
let rate = this.rate.nativeElement;
rate.innerHTML = '<span> ' + event.value + '</span>';
}
}