In my table, I have a specific requirement for the first column to change color based on a variable within my class. For instance, within my DisplayProject.ts class, there is a property named indexOfColor
DisplayProject.ts
export class DisplayProject implements OnInit {
ngOnInit(): void {
}
project: Project;
indexOfColor: number = 1; // could be 2
constructor () {
}
}
DisplayProject.html
<table>
<thead>
<tr>
<th>the project name</th>
<th>the project date</th>
</tr>
</thead>
<tbody>
<tr>
<td>project.name</td>
<td>project.date</td>
</tr>
</tbody>
</table>
I aim to have the "the project name" column display in green when indexOfColor = 1
and blue when indexOfColor = 2
Any suggestions ?