Angular 2 Material md-chips color attribute not working

Peter picture Peter · Apr 12, 2017 · Viewed 7.7k times · Source

When i try to style my md-chips with the color attribute nothing happens. According to the guide https://material.angular.io/components/component/chips this has to work. All my other elements style without problems.

<md-chip-list>
    <md-chip color="primary"> Chicken </md-chip>
    <md-chip color="warn"> Table </md-chip>
    <md-chip color="accent"> Tree </md-chip>
    <md-chip> Eight </md-chip>
</md-chip-list>

Result:enter image description here

Does anybody know how to fix this?

Thanks in advance!

Answer

Riron picture Riron · Apr 12, 2017

According to the plunkr example, the chips are only colored when the selected attribute is set to true :

<md-chip color="accent" selected="true">Chicken</md-chip>