I am try to add my custom color like red and green in @angular2-material/slide-toggle. If slide-toggle is disabled so color is red and if enabled so color is green.
My component.html code here:-
<md-slide-toggle
(change)="testChange($event)"
[color]="myColor">
</md-slide-toggle>
My component.td code here :-
myColor;
testChange(event) {
alert(event)
if(event == true)
{
this.myColor = "#006400";
}
else
{
this.myColor = "#FF0000";
}
}
I repeat my questions:-
Thanks!
You need to add your own custom colour theme, then you can set [color]='primary'
etc, the docs to create your own theme are here