Answers for "mat-checkbox toggle event"

0

mat-checkbox change

// in HTML
<mat-checkbox id="parent" (change)="onChangeDemo($event)"></mat-checkbox>
// in TS
onChangeDemo(ob: MatCheckboxChange) {
    console.log(ob.checked + " => " + ob.source.id);
}
Posted by: Guest on June-30-2021
0

mat-button-toggle checked functionality

change(evt: any) {
   if (this.value.length === 1)
      this.oldValue = this.value[0];

   if (this.value.length === 0)
      this.value = [this.oldValue];

}
Posted by: Guest on September-28-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language