import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Course, selectedCourse } from 'app/models/capability-transformation/course-list.model';

@Injectable()
export class EmployeeNavBarService {
  private currentPage: Subject<number> = new Subject<number>();
  private selectedCourse: BehaviorSubject<Course> = new BehaviorSubject<Course>(new Course());
  private selectedCourseData: Subject<Array<object>> = new Subject<Array<object>>();

  public currentPage$ = this.currentPage.asObservable();
  public selectedCourse$ = this.selectedCourse.asObservable();
  public selectedCourseData$ = this.selectedCourseData.asObservable();

  setCurrentPage(value: number) {
    this.currentPage.next(value);
  }

  setCourse(course: Course) {
    this.selectedCourse.next(course);
  }
  setSelectedCourse(courseData) {
    this.selectedCourseData.next(courseData);
  }
}
