Skip to content
Snippets Groups Projects
term-container.component.ts 682 B
Newer Older
import { Component, Input } from '@angular/core';
import { Term } from '../../core/models/term';
import { Course } from '../../core/models/course';
pnogal's avatar
pnogal committed
import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
	selector: 'app-term-container',
	templateUrl: './term-container.component.html',
	styleUrls: ['./term-container.component.scss']
export class TermContainerComponent {
	@Input() term: Term;
	@Input() courses: Course[];
	terms: any[];

	getTotalCredits() {
		if (!this.courses) {
			return '0';
		}
		let total = 0;
		for (const course of this.courses) {
			total += course.credits;
		}
		return total;
	}