Angular2 [ngClass] – Combining direct binding with conditional classes

I currently have two different working implementations of [ngClass] on an element;

[ngClass]="{ selected: element.isSelected, highlighted: element.isHighlighted}"



Is it possible to combine both of these approaches in the template, or do I have to create a method in my component to return an array of classes based on the logic above?


Source: stackoverflow-javascript