How to set the color of an icon in Angular Material?

后端 未结 7 1655
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-04 23:48

I have this, which I would assume to work, but doesn\'t:

home


        
相关标签:
7条回答
  • 2021-02-05 00:15

    Or simply

    add to your element

    [ngStyle]="{'color': myVariableColor}"

    eg

    <mat-icon [ngStyle]="{'color': myVariableColor}">{{ getActivityIcon() }}</mat-icon>

    Where color can be defined at another component etc

    0 讨论(0)
提交回复
热议问题