import { Component, OnInit, Input,Output, EventEmitter  } from '@angular/core';
import {CoachCandidateEvaluationService} from 'app/coach/shared/service/coach-candidate-evaluation.service';

@Component({
  selector: 'app-switchtabs',
  templateUrl: './switchtabs.component.html',
  styleUrls: ['./switchtabs.component.css']
})
export class SwitchtabsComponent implements OnInit {

  @Input() roles:any;

  @Output() messageEvent = new EventEmitter<string>();

  Role: string;
  constructor(private CoachCandidateEvaluationService:CoachCandidateEvaluationService) { }

  ngOnInit() {

    this.CoachCandidateEvaluationService.set_proper_active_tab.subscribe(value => {
      this.Role = this.roles[value];
    });

    //this.Role = this.roles[0];
  }
  Selected(role) {
    this.Role = role;
    this.messageEvent.emit(role);
  }

}
