Take a look at this Plunker: https://plnkr.co/edit/yu95hUrKlUh4Ttc5SwYD?p=preview
When I\'m using
, I am able to modify the valu
public selectedVal: string;
constructor() { }
ngOnInit(){
this.selectedVal ='option1';
}
public onValChange(val: string) {
this.selectedVal = val;
}
<mat-button-toggle-group #group="matButtonToggleGroup" [value]="selectedVal" (change)="onValChange(group.value)" >
<mat-button-toggle value="option1">
Option 1
</mat-button-toggle>
<mat-button-toggle value="option2">
Option 2
</mat-button-toggle>
</mat-button-toggle-group>