Using [style]:

...
<div [style.color]="{ booleanExp ? 'red': 'green' }"></div>
...

Using [ngStyle]:

...
<div [ngStyle]="{ 'color': red }">...</div>
...
<h2 [ngStyle]="getStyles()">...</h2>
...
...
getStyles() {
...
return { color: 'red', fontWeight: 'bold', 'background-color': 'grey' };
}
...

Using [class]:

...
<div
[class.class-1]="booleanParam"
[class.class-2]="funcReturningBoolean()"
[class.class-3]="booleanExp">
...</div>
...

Using [ngClass]:

...
<div [ngClass]="{
'class-1': booleanParam,
'class-2 class-3': funcReturningBoolean()
}"
>
...</div>
...
<h2 [ngClass]="getClass()">...</h2>
...
...
getClass() {
...
return ['class-1', 'class-2'];
// or
return { 'class-1': booleanParam, 'class-2': booleanExp };
}
...