I am trying to change the color of displayed content based on user selection in an Angular application. Specifically, when a user chooses an option from a dropdown list, I want the displayed text to reflect their choice by changing colors. For example, if the user selects "Confirmed" from the dropdown, the text should display in green. If they select "Not Confirmed", the text should be red. And if they choose "Confirmed and Shipped", the text should appear yellow. I have been struggling to implement this functionality as I am new to Angular. Any guidance on how to achieve this would be greatly appreciated.
<mat-form-field>
<mat-select placeholder="Status" [formControl]="statusTypeFilter">
<mat-option value="1">Confirmed</mat-option>
<mat-option value="2">Not Confirmed</mat-option>
<mat-option value="3">Confirmed and Shipped</mat-option>
</mat-form-field>
<div class="table-container mat-elevation-z8">
<table mat-table [dataSource]="ItemConfirmationList" multiTemplateDataRows matSort matSortActive="no">
<ng-container matColumnDef="StatusName">
<th mat-header-cell *matHeaderCellDef mat-sort- header>Status</th>
<td mat-cell *matCellDef="let element">{{element.StatusName }}</td>
</ng-container>
</div>