<div [style.background-color]="activity.status == 'Pending' ? 'red' : 'green'"></div> <div [ngStyle]="{'backgroundColor': activity.status == 'Pending' ? 'red' : 'green' }"></div>