How to set text color in Angular-Material?

前端 未结 9 1518
被撕碎了的回忆
被撕碎了的回忆 2020-12-30 19:20

I want to set one word in a sentence to have md-primary color, and another word to have the accent color. I assumed something like this:

Hel
9条回答
  •  离开以前
    2020-12-30 19:41

    The latests bits bring good news to this issue... This functionality has been added to the 1.1.0-rc3 (2016-04-13) version. It's not stable yet, but my first test on it are satisfactory.

    Now you can use the mdColors directive and $mdColors service in conjunction with themes to achieve what you're looking for.

    Please, take a look at:

    https://github.com/angular/material/blob/master/CHANGELOG.md#110-rc3-2016-04-13

    to see the announcement, and look for the mdColor directive and $mdColor service in the docs for some examples.

提交回复
热议问题