How can the condition be reduced to one line?
I set the condition like this:
<mat-chip-list>
<mat-chip color="accent" *ngIf="letter.status == 'Completed'" selected>
{{ letter.status }}
</mat-chip>
<mat-chip color="warn" *ngIf="letter.status == 'In Work'" selected>
{{letter.status }}
</mat-chip>
</mat-chip-list>
Is it possible to reduced it down so it looks something like this:
<mat-chip color="letter.status == 'Completed' ? accent : warn" selected>
{{ letter.status }}
</mat-chip>
@Input() color: ThemePalette Theme color palette for the component.
color is an input property
color="accent"
static [color]="expr ? 'accent' : 'warn'"
dynamic
<mat-chip-list>
<mat-chip
[color]="letter.status == 'Completed' ? 'accent' : 'warn'"
selected
selected
>
{{ letter.status }}
</mat-chip>
</mat-chip-list>
Stackblitz