Skip to content

Commit

Permalink
Serverless Angular with Firebase Course
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Dec 20, 2018
1 parent 37b1ed6 commit 95c0039
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 27 deletions.
16 changes: 0 additions & 16 deletions src/app/course-dialog/course-dialog.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,6 @@ <h2 mat-dialog-title>{{description}}</h2>

</mat-form-field>

<mat-form-field>

<mat-select placeholder="Select category"
formControlName="category">

<mat-option value="BEGINNER">
Beginner</mat-option>
<mat-option value="INTERMEDIATE">
Intermediate</mat-option>
<mat-option value="ADVANCED">
Advanced</mat-option>

</mat-select>

</mat-form-field>

<mat-form-field>

<input matInput [matDatepicker]="myDatepicker"
Expand Down
10 changes: 4 additions & 6 deletions src/app/course-dialog/course-dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ export class CourseDialogComponent implements OnInit {
constructor(
private fb: FormBuilder,
private dialogRef: MatDialogRef<CourseDialogComponent>,
@Inject(MAT_DIALOG_DATA) {description,longDescription,
category}:Course ) {
@Inject(MAT_DIALOG_DATA) {titles}:Course ) {

this.description = description;
this.description = titles.description;


this.form = fb.group({
description: [description, Validators.required],
category: [category, Validators.required],
description: [titles.description, Validators.required],
releasedAt: [moment(), Validators.required],
longDescription: [longDescription,Validators.required]
longDescription: [titles.longDescription,Validators.required]
});

}
Expand Down
4 changes: 2 additions & 2 deletions src/app/courses-card-list/courses-card-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export class CoursesCardListComponent implements OnInit {

}

editCourse({description, longDescription, category}:Course) {
editCourse({titles}:Course) {

const dialogConfig = new MatDialogConfig();

dialogConfig.disableClose = true;
dialogConfig.autoFocus = true;

dialogConfig.data = {
description, longDescription, category
titles
};

const dialogRef = this.dialog.open(CourseDialogComponent,
Expand Down
8 changes: 5 additions & 3 deletions src/app/model/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

export interface Course {
id:string;
description:string;
titles: {
description:string;
longDescription: string;
};
iconUrl: string;
courseListIcon: string;
longDescription: string;
category:string;
categories:string[];
lessonsCount:number;
}

0 comments on commit 95c0039

Please sign in to comment.