I have a mat icon I'd like to be a certain color depending on the URL of the user (which is dealt with in the boolean expression). I used a ternary expression to change the background color which worked fine, but when I added the second ternary expression to change the color of the image/icon itself the first expression stopped working, and the second expression does not either.
<button class="button-spacer" [style.background-color]="atAnnouncements ? 'black' : 'white'" routerLink="/announcements" mat-mini-fab
matTooltip="Announcements">
<mat-icon [ngStyle]="{'color': atAnnouncements ? '#D09B2C' : 'black'}">announcement</mat-icon>
</button>
When leaving the ngStyle as a fixed color rather than ternary expression the first ternary works just fine.
So ideally, when atAnnouncements is true we have a black background color and the hex colored icon, and white background color and black icon when false.