I have class with some properties:
export class Task {
name: string;
state: number;
}
In my component.ts I have an array of objects with class Task (tasks).
In template I show them like this:
<div *ngFor='let task of tasks'>
<p>{{ task.name }}</p>
<p>{{ task.state }}</p>
</div>
Is it possible to change styling of my div based on task.state property? For example, I want it to be with red background when it's 0 and yellow when it's 1. I think I need to use directives, but I can't understand how.