Skip to content
Snippets Groups Projects
degree-planner.component.ts 964 B
Newer Older
import { Component } from '@angular/core';

import { DataService } from '../core/data.service';
import { DegreePlan } from '../core/models/degree-plan';
import { Course } from '../core/models/course';
import { Term } from '../core/models/term';
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed

@Component({
	selector: 'app-degree-planner',
	templateUrl: './degree-planner.component.html',
	styleUrls: ['./degree-planner.component.scss']
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed
})
export class DegreePlannerComponent {
	degreePlans: DegreePlan[];
	degreePlanCourses: Course[];
	selectedDegreePlan: number;
	terms: Term[];
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed

	constructor(private dataService: DataService) {
		this.dataService.getDegreePlans()
		.subscribe(data => {
			this.degreePlans = data;
			this.selectedDegreePlan = this.degreePlans[0].roadmapId;
		});

		this.dataService.getDegreePlannerCourseData()
		.subscribe(degreePlanCourses => {
			this.degreePlanCourses = degreePlanCourses;
		});
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed

		this.dataService.getTerms()
		.subscribe(terms => {
			this.terms = terms;
		});
jvanboxtel@wisc.edu's avatar
jvanboxtel@wisc.edu committed
}