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

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

  @Input() isFemale = false;
  @Input() isMale = false;
  value: number;
  @Output() selected = new EventEmitter();

  constructor() {
  }

  select(cond: boolean) {
    if (cond) {
      this.isFemale = true;
      this.isMale = false;
      this.value = 2;
      this.selected.emit(this.value);
    } else {
      this.isFemale = false;
      this.isMale = true;
      this.value = 1;
      this.selected.emit(this.value);

    }
  }
  ngOnInit() {

  }

}
