Basic problem of Angular4.0 event binding $event

such as < md-slide-toggle (change) = "onChange ($event.checked)" > switch < / md-slide-toggle > , event binding. $event is a DOM Event object,

where $event.checked how does the boolean value be generated?

Template fragment:

  <md-slide-toggle (change)="onChange($event.checked)"></md-slide-toggle>

TS fragment:

 @Output() toggleDarkTheme = new EventEmitter<boolean>();

 onChange(checked: boolean) {
    this.toggleDarkTheme.emit(checked);
  }

Oh, I can"t believe I didn"t answer. Did I not make myself clear?

Mar.23,2021

$event is not a DOM Event object. Instead, it is the specific data object that the component sends back to you through Output .
look at his source code more quickly than asking questions. I don't know if it is material2 . But the truth is the same.
ide-toggle/slide-toggle.ts" rel=" nofollow noreferrer "> https://github.com/angular/ma.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3be40-2c2fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3be40-2c2fa.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?