I am having trouble adding a class based on a condition
<tr *ngFor="let time of times; let i = index">
<td [ngClass]="{'red-time':checkInvalid(time['Proles Arrive'])}">{{time['Proles Arrive']}}</td>
</tr>
This code snippet is from my HTML file
checkInvalid(entry: string){
console.log("This is the entry:" + entry);
return entry === 'Invalid Entry';
}
Despite logging "Invalid Entry", the class is not being added as expected.
Even trying "[ngClass]="{'red-time':true}" does not work to add the class
Any suggestions on how to fix this issue?