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

@Component({
  selector: 'lib-radio-button',
  templateUrl: './radio-button.component.html',
  styleUrls: ['./radio-button.component.scss'],
})
export class RadioButtonComponent implements OnInit {
  @Input() radioButton: RadioButton;
  @Output() clickRadio: EventEmitter<RadioButton> = new EventEmitter();

  constructor() {}

  ngOnInit() {}

  clickRadioButton() {
    this.clickRadio.emit({ ...this.radioButton, selected: !this.radioButton.selected });
  }
}
