I have an element I want to apply a certain class to, so I used a [class.active] conditional that is watching an Observable changes. But when I toggle it doesn't apply to the following li
and breaks down the whole app:
<li *ngFor="let room of activeRooms$ | async" [class.active]="room.name === (currentRoomName$ | async)">
I found that if i use to [ngClass] instead, it works perfectly:
<li *ngFor="let room of activeRooms$ | async" [ngClass]="{ active: room.name === (currentRoomName$ | async)}">
Why is that? Can anyone throw some light on this?
Thanks!