import { ChangeDetectionStrategy , Component , EventEmitter , HostListener , Input , Output , } from '@angular/core' ; @ Component ( { selector : 'kirby-toggle-button' , templateUrl : './toggle-button.component.html' , changeDetection : ChangeDetectionStrategy . OnPush , } ) export class ToggleButtonComponent { @ Input ( ) checked : boolean ; @ Output ( ) checkChanged = new EventEmitter < boolean > ( ) ; @ HostListener ( 'click' ) onClick ( ) { this . checked = ! this . checked ; this . checkChanged . emit ( this . checked ) ; } }