o3-2025-04-16· OpenAI
LMArena Human Preference 140K
<ng-container matColumnDef="gender"> <th mat-header-cell matHeaderCellDef>Gender</th>…
- User
add icons like below code liek above <th mat-header-cell *matHeaderCellDef>Gender <td mat-cell *matCellDef="let match"> {{ match.person?.gender || 'Unknown' | titlecase }}
- Assistant
Below is a plug-and-play version of the second column that shows
• an icon for male, female, or unknown
• the gender text right next to the icon (optional – remove the span if you only want the icon).<!-- Gender column with icons --> <ng-container matColumnDef="gender"> <th mat-header-cell *matHeaderCellDef>Gender</th> <td mat-cell *matCellDef="let match"> <!-- Choose the correct icon --> <ng-container [ngSwitch]="match.person?.gender"> <!-- Male --> <mat-icon *ngSwitchCase="'male'" color="primary" aria-label="Male icon">male</mat-icon> <!-- Female --> <mat-icon *ngSwitchCase="'female'" color="accent" aria-label="Female icon">female</mat-icon> <!-- Anything else / Unknown --> <mat-icon *ngSwitchDefault color="warn" aria-label="Unknown gender icon">help_outline</mat-icon> </ng-container> <!-- Optional: keep the text beside the icon --> <span style="margin-left:4px"> {{ (match.person?.gender || 'Unknown') | titlecase }} </span> </td> </ng-container>What you need to make it work
- Import
MatIconModulein the module that declares your table component. - Make sure the Material icons font is loaded in your
index.html(Angular Material’s getting-started step already adds it):
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">That’s it—now the column behaves just like your first example, but wired to
match.person?.gender. 🎉 - Import
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.