import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';
import { Observable } from 'rxjs';
import { TestingInformationService } from 'src/app/core/service/testing-information/testing-information.service';

@Component({
  selector: 'app-change-exam-room',
  templateUrl: './change-exam-room.container.html',
  styleUrls: ['./change-exam-room.container.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ChangeExamRoomContainer implements OnInit {
  testingInfo$ = new Observable()
  constructor(
    private testingInfomationSV: TestingInformationService,
  ) { }

  ngOnInit(): void {
    this.testingInfo$ = this.testingInfomationSV.search(`?is_open=true`)
  }

  search(query){
    if(query) return this.testingInfo$ = this.testingInfomationSV.search(`?${query}`);
    if(!query) return this.testingInfo$ = this.testingInfomationSV.search(`?is_open=true`);
  }


}
