Angular UI Components Documentation
The Angular TagCloud displays a collection of user-generated tags accompanying the articles, posts, or videos on your website. This guide adds the Angular TagCloud (jqxTagCloud) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-ngjqwidgets-ng/jqxtagcloud 
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 jqxTagCloudModule to the imports of the component that uses it.
import { Component } from '@angular/core';
import { jqxTagCloudModule } from 'jqwidgets-ng/jqxtagcloud';
@Component({
selector: 'app-root',
imports: [jqxTagCloudModule],
templateUrl: './app.html'
})
export class App {}
The source of the live Default Functionality demo.
<jqxTagCloud #tagCloud
[width]="getWidth()"
[source]="dataAdapter"
[displayMember]="'countryName'"
[valueMember]="'technologyRating'">
</jqxTagCloud>
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { jqxTagCloudModule } from 'jqwidgets-ng/jqxtagcloud';
import { jqxButtonModule } from 'jqwidgets-ng/jqxbuttons';
import { jqxInputModule } from 'jqwidgets-ng/jqxinput';
@Component({
imports: [CommonModule, FormsModule, jqxTagCloudModule, jqxButtonModule, jqxInputModule],
selector: 'app-root',
templateUrl: './app.html'
})
export class App {
data: any[] = [
{ countryName: 'Australia', technologyRating: 35 },
{ countryName: 'United States', technologyRating: 60 },
{ countryName: 'Germany', technologyRating: 55 },
{ countryName: 'Brasil', technologyRating: 20 },
{ countryName: 'United Kingdom', technologyRating: 50 },
{ countryName: 'Japan', technologyRating: 80 }
];
getWidth(): any {
if (document.body.offsetWidth < 600) {
return '90%';
}
return 600;
}
source: any = {
localdata: this.data,
datatype: 'array',
datafields: [{ name: 'countryName' }, { name: 'technologyRating' }]
};
dataAdapter: any = new jqx.dataAdapter(this.source);
}
Options are inputs, bound with [name]="value".
Events are outputs named on plus the event name with a capital first letter. For example, bindingComplete: This event is triggered when the widget has completed binding to a dataAdapter.
<jqxTagCloud (onBindingComplete)="onBindingComplete($event)"></jqxTagCloud>
onBindingComplete(event: any): void {
console.log(event.args);
}
Get the component with a signal query and call its methods. For example, findTagIndex: Returns the index of the first tag with the specified label (displayMember).
<jqxTagCloud #myTagCloud></jqxTagCloud>
import { Component, viewChild } from '@angular/core';
import { jqxTagCloudModule, jqxTagCloudComponent } from 'jqwidgets-ng/jqxtagcloud';
@Component({
selector: 'app-root',
imports: [jqxTagCloudModule],
templateUrl: './app.html'
})
export class App {
readonly myTagCloud = viewChild.required<jqxTagCloudComponent>('myTagCloud');
run(): void {
const index = this.myTagCloud().findTagIndex('Germany');
console.log(index);
}
}