Issue
I'm trying to use a switch in a form to toggle the appearance of one of two dropdown menus in the same form.
Can I use the MatSlideToggleChange
event emitted by a MatSlide
class toggle to achieve my desired result?
Solution
you can use output change property to toogle its change value
<mat-slide-toggle
[ngModel]="checked"
(change)="changed()"
class="example-margin"
[color]="color"
>
Slide me! {{checked}}
</mat-slide-toggle>
component
color = 'accent';
checked = false;
changed(){
console.log(this.checked)
}
demo stackblitz
Answered By - Abinesh Joyel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.