import { Component, ViewChild, AfterViewInit, ViewEncapsulation } from '@angular/core'; import { jqxDropDownButtonComponent } from 'jqwidgets-scripts/jqwidgets-ts/angular_jqxdropdownbutton'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], encapsulation: ViewEncapsulation.None }) export class AppComponent implements AfterViewInit { @ViewChild('dropDownButton') myDropDown: jqxDropDownButtonComponent; ngAfterViewInit(): void { this.myDropDown.setContent(this.getTextElementByColor({ hex: "FFAABB" })); } getTextElementByColor(color: any): any { if (color == 'transparent' || color.hex == "") { return '