Skip to content

Commit

Permalink
fix exploring existing
Browse files Browse the repository at this point in the history
  • Loading branch information
aidamonfort committed Mar 5, 2020
1 parent e73d45c commit c0ef843
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 206 deletions.
4 changes: 4 additions & 0 deletions src/app/services/course.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { BokInput } from '../model/bokinput';
import { Lecture } from './lecture.service';
import { Field } from './fields.service';

const collection = 'courses';

Expand All @@ -25,6 +26,7 @@ export class Course extends Object {
public affiliation: string;
public levelPublic: Boolean;
public eqf: number;
public field: Field;

data: any;

Expand All @@ -50,6 +52,7 @@ export class Course extends Object {
this.affiliation = currentNode.data.affiliation ? currentNode.data.affiliation : '';
this.levelPublic = currentNode.data.levelPublic ? currentNode.data.levelPublic : true;
this.eqf = currentNode.data.eqf ? currentNode.data.eqf : 0;
this.field = currentNode.data.field ? currentNode.data.field : null;

} else {
this._id = '';
Expand All @@ -68,6 +71,7 @@ export class Course extends Object {
this.affiliation = '';
this.levelPublic = true;
this.eqf = 0;
this.field = null;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/services/lecture.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { BokInput } from '../model/bokinput';
import { Field } from './fields.service';

const collection = 'lectures';

Expand All @@ -20,6 +21,7 @@ export class Lecture extends Object {
public levelPublic: Boolean;
public children: any[];
public eqf: number;
public field: Field;

constructor(
public currentNode: any = null
Expand All @@ -40,6 +42,7 @@ export class Lecture extends Object {
this.levelPublic = currentNode.data.levelPublic ? currentNode.data.levelPublic : true;
this.children = [];
this.eqf = currentNode.data.eqf ? currentNode.data.eqf : 0;
this.field = currentNode.data.field ? currentNode.data.field : null;

} else {
this._id = '';
Expand All @@ -55,6 +58,7 @@ export class Lecture extends Object {
this.levelPublic = true;
this.children = [];
this.eqf = 0;
this.field = null;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/services/module.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { AngularFirestore } from '@angular/fire/firestore';
import { Observable } from 'rxjs';
import { BokInput } from '../model/bokinput';
import { Course } from './course.service';
import { Field } from './fields.service';

const collection = 'modules';

Expand All @@ -23,6 +24,7 @@ export class Module extends Object {
public affiliation: string;
public levelPublic: Boolean;
public eqf: number;
public field: Field;

constructor(
public currentNode: any = null
Expand Down Expand Up @@ -54,6 +56,7 @@ export class Module extends Object {
this.affiliation = currentNode.data.affiliation ? currentNode.data.affiliation : '';
this.levelPublic = currentNode.data.levelPublic ? currentNode.data.levelPublic : true;
this.eqf = currentNode.data.eqf ? currentNode.data.eqf : 0;
this.field = currentNode.data.field ? currentNode.data.field : null;

} else {
this._id = '';
Expand All @@ -71,6 +74,7 @@ export class Module extends Object {
this.affiliation = '';
this.levelPublic = true;
this.eqf = 0;
this.field = null;
}
}
}
Expand Down
Loading

0 comments on commit c0ef843

Please sign in to comment.