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:-
- How to add custom color in angular2 material slide-toggle?
- If slider-toggle is disabled so color is red otherwise green.
Thanks!