Is there a better way to do the following? The following is spinning the CPU in Chrome (as per Javascript profiler).
<div *ngFor="let item of items">
<itemComp [item]="item" [active]="item == service.activeItem"></itemComp>
</div>
Is there a way for each of the itemComp components to subscribe for a notification when they become active?
For ex., once they are rendered, let's say the user clicks on any of the items to mark as active. Only one item can be active any time. and say, I want to just change the background color of the active item to highlight it. In this case the current active item becomes inactive and a new item becomes active. How do I propagate this change?