import { Component, OnInit, EventEmitter, Output, Input } from '@angular/core';

@Component({
  selector: 'toggle-button',
  templateUrl: './toggle-button.component.html',
  styleUrls: ['./toggle-button.component.scss'],
})
export class ToggleButtonComponent implements OnInit {

  @Input() title: string;
  @Output() toggled  = new EventEmitter();
  public pressed = false;
  constructor() { }

  ngOnInit() {}

  public onClicked() {
    this.pressed = ! this.pressed;
    this.toggled.emit(this.pressed);
  }

}
