import {
  Component,
  OnInit,
  ChangeDetectionStrategy,
  Input,
  Output,
  EventEmitter,
  OnChanges,
  AfterViewInit,
  ChangeDetectorRef
} from '@angular/core';
import {BaseList} from '../../../../../../core/base/base-list';
import {MatTableDataSource} from '@angular/material/table';
import {concatMap, filter, tap} from 'rxjs/operators';
import {Router} from '@angular/router';
import {TestingInformationService} from '../../../../../../core/service/testing-information/testing-information.service';
import {SweetalertService} from '../../../../../../core/service/sweetalert/sweetalert';

@Component({
  selector: 'app-change-exam-information-list',
  templateUrl: './change-exam-information-list.component.html',
  styleUrls: ['./change-exam-information-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ChangeExamInformationListComponent extends BaseList implements OnInit, OnChanges , AfterViewInit{
  @Output() Tab = new EventEmitter();
  @Input() subjectList: any = [];
  @Input() subjectListFalse: any = [];
  @Output() edit = new EventEmitter();
  @Output() expand = new EventEmitter();
  @Output() info = new EventEmitter();
  @Output() delete = new EventEmitter();
  column = ['1', '2', '3', '4', '5', '6'];
  column2 = ['1', '2', '3', '4', '5', '6'];
  constructor(
    private router: Router,
    private TestinforSV: TestingInformationService,
    private cdr: ChangeDetectorRef,
    private swSV: SweetalertService
  ) {
    super();
  }

  ngOnInit(): void {
    this.Tab.emit(0);
  }

  ngOnChanges(){
    // if (this.Tab === 0){
    //   console.log(this.subjectListFalse)
    // }else if (this.Tab === 1){
    //   console.log(this.subjectList)
    // }
    console.log(this.subjectListFalse)
    console.log(this.subjectList)
  }

  ngAfterViewInit() {
  }

  onEdit(id){
    this.edit.emit(id);
  }

  onInfo(id){
    this.info.emit(id);
  }

  onExpand(id){
    this.expand.emit(id);
  }


  onDelete(id){
    this.delete.emit(id);
  }

  onTabChanged(event){
    this.Tab.emit(event);
  }


}
