Newer
Older
import { Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material';
import { DegreePlannerApiService } from '@app/degree-planner/services/api.service';
// tslint:disable-next-line:max-line-length
import { CourseDetailsDialogComponent } from '@app/degree-planner/dialogs/course-details-dialog/course-details-dialog.component';
// tslint:disable-next-line:max-line-length
import { RemoveCourseConfirmDialogComponent } from '@app/degree-planner/dialogs/remove-course-confirm-dialog/remove-course-confirm-dialog.component';
selector: 'cse-course-item',
templateUrl: './course-item.component.html',
styleUrls: ['./course-item.component.scss'],
export class CourseItemComponent implements OnInit {
status; // TODO make this work k thx plz!?
@Input() course: Course;
@Input() disabled: string;
@Input() type: 'saved' | 'course' | 'search';
constructor(private api: DegreePlannerApiService, public dialog: MatDialog) {}
this.api
.getCourseDetails(course.subjectCode, course.courseId)
.subscribe(courseDetails => {
const dialogRef = this.dialog.open(CourseDetailsDialogComponent, {
data: { courseDetails: courseDetails },
});
});
}
openRemoveConfirmationDialog() {
const dialogRef = this.dialog.open(RemoveCourseConfirmDialogComponent, {
data: { course: this.course, type: this.type },
});
}