I have a view on angular just like this:
https://i.sstatic.net/JimWN.png
And this is my dashboard.component.ts:
export class DashboardComponent implements OnInit {
tablePresetColumns;
tablePresetData;
ngOnInit() {
this.tablePresetColumns = [{id: 1,content: 'Username'},{id: 2,content: 'Status'}];
this.tablePresetData = [[{id: 1,content: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="33595c5b5d1d575c567341525d575c5e1d505c5e">[email protected]</a>'},{id: 2,content: 'Busy'}],[{id: 1,content: '<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f98d9c8a8dcbb98b98979d9694d79a9694">[email protected]</a>'},{id: 2,content: 'overload'}]];
}
}
And this is the way i call the table on dashboard.component:
<div eds-tile class="xl-4" style="height: 700px">
<eds-tile-title>User on Shift</eds-tile-title>
<eds-table [columns]="tablePresetColumns" [data]="tablePresetData" [modes]="['compact', 'dashed']"></eds-table>
</div>
eds-table:
selector: 'eds-table',
template: "<table class=\"table\" [ngClass]=\"modes\">\n <thead *ngIf=\"columns\">\n <tr>\n <th *ngFor=\"let col of columns\">\n {{col.content}}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of data\">\n <td *ngFor=\"let cell of row\">\n {{cell.content}}\n </td>\n </tr>\n </tbody>\n</table>\n",
If I want to add color based on different statuses, such as changing Busy text to green, Idle to Yellow, and Overload to Red, what should I do?
I appreciate your help.