[CSS]: Applying CSS to ListView items


#1

Hi guys, I am trying to add/remove css classes to a Label inside a ListView when I click on it. This is how the html looks like:

<ListView #selectListView [items]="_auxSelectItems" (itemTap)="onItemTap($event)">
    <ng-template let-item="item">
        <Label [class]="'item item-content' + (_isSelected ? 'item-selected' : '')" [text]="item.Description" textWrap="true" style="padding:10;"></Label>
    </ng-template>
</ListView>

Then onItemTap event, I try to set the css to the label like this:

onItemTap(event: ItemEventData) : void {
    let label: Label = <Label>event.view;
    label.className = "item-selected";
}

Am I missing something?

Thanks!