I'm crating a side bar menu using angular material. I did'nt find a way to change the button color based on some component property.
I already read the documentation: https://material.angular.io/components/button/overview
And about themes it only says:
Buttons can be colored in terms of the current theme using the color property to set the background color to primary, accent, or warn.
This is my code:
<button
*ngFor="let link of links; let i = index"
mat-raised-button
color="primary"
(click)="selectedIndex = i"
[routerLink]="link.routerLink">
</button>
I don't even know if it is possible, but something like this is what I'm looking for:
<button
*ngFor="let link of links; let i = index"
mat-raised-button
(click)="selectedIndex = i"
[color]="selectedIndex === i ? primary : warm"
[routerLink]="link.routerLink">
</button>