I have a problem with customizing the single item.
I create an array of type SelectItem, to one of these items imposed the "styleClass".
Code: Select all
public static readonly tipoProcedimento : SelectItem[] =
[
{ label: '(Tutte)', value: 0 },
{ label: 'Valutazione Ambientale Strategica', value: 1, styleClass: 'macroFamiglia' }
]
Seeing the js of the dropdown, he doesn't import the styleClass attribute into the template.
Code: Select all
DropdownItem = __decorate([
core_1.Component({
selector: 'p-dropdownItem',
template: "\n <li (click)=\"onOptionClick($event)\" role=\"option\"\n [attr.aria-label]=\"option.label\"\n [ngStyle]=\"{'height': itemSize + 'px'}\"\n [ngClass]=\"{'ui-dropdown-item ui-corner-all':true,\n 'ui-state-highlight': selected,\n 'ui-state-disabled':(option.disabled),\n 'ui-dropdown-item-empty': !option.label||option.label.length === 0}\">\n <span *ngIf=\"!template\" >{{option.label||'empty'}}</span>\n <ng-container *ngTemplateOutlet=\"template; context: {$implicit: option}\"></ng-container>\n </li>\n "
})
], DropdownItem);
Is it a primeng error? am I wrong to do something?