diff --git a/src/app/degree-planner/shared/shared.module.ts b/src/app/degree-planner/shared/shared.module.ts index 80ead0245a1116aca1635cd51852845d943f41aa..adc9dc21cf52067c3c8f968999eef752ec9d8a49 100644 --- a/src/app/degree-planner/shared/shared.module.ts +++ b/src/app/degree-planner/shared/shared.module.ts @@ -1,10 +1,11 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CourseItemComponent } from './course-item/course-item.component'; +import { DragDropModule } from '@angular/cdk/drag-drop'; @NgModule({ - imports: [ CommonModule ], - exports: [ CourseItemComponent ], + imports: [ CommonModule, DragDropModule ], + exports: [ CourseItemComponent, DragDropModule ], declarations: [ CourseItemComponent ] }) diff --git a/src/app/degree-planner/term-container/term-container.component.html b/src/app/degree-planner/term-container/term-container.component.html index 02d87519ff37e9edc1d61b1ca286460d8249a0e6..cdbb4b32a7d7edbe616df1b9d40c516dc81e9043 100644 --- a/src/app/degree-planner/term-container/term-container.component.html +++ b/src/app/degree-planner/term-container/term-container.component.html @@ -2,8 +2,8 @@ <div fxLayout="row" fxLayoutAlign="space-between stretch"> <h2>{{ term.termCode | getTermDescription }}</h2><p class="text-right semi-bold credits">Credits: 13</p> </div> - <div> - <app-course-item *ngFor="let course of courses" [course]="course" [status]="'complete'"></app-course-item> + <div cdkDropList> + <app-course-item *ngFor="let course of courses" [course]="course" [status]="'complete'" cdkDrag></app-course-item> <p *ngIf="!courses" class="no-courses text-center semi-bold">No Courses Taken</p> </div> </mat-card> \ No newline at end of file diff --git a/src/app/degree-planner/term-container/term-container.component.ts b/src/app/degree-planner/term-container/term-container.component.ts index 1c4e3485844271388d7199a0d3dd86e627cfc92d..9a5ed3d598a8f8e7953f751b6ced79afdd93d1b5 100644 --- a/src/app/degree-planner/term-container/term-container.component.ts +++ b/src/app/degree-planner/term-container/term-container.component.ts @@ -1,6 +1,7 @@ import { Component, Input } from '@angular/core'; import { Term } from '../../core/models/term'; import { Course } from '../../core/models/course'; +import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; @Component({ selector: 'app-term-container',