Skip to content

Commit a9caaef

Browse files
author
Your Name
committed
Firebase & AngularFire In Depth
1 parent 35933d0 commit a9caaef

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/app/create-course/create-course.component.html

+12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ <h3>Create New Course</h3>
1818

1919
<input type="file" (change)="uploadThumbnail($event)">
2020

21+
<div class="upload-progress" *ngIf="(percentageChanges$ | async) as percentage">
22+
23+
<mat-progress-bar class="progress-bar"
24+
mode="determinate"
25+
[value]="percentage">
26+
27+
</mat-progress-bar>
28+
29+
<span>{{percentage / 100 | percent}}</span>
30+
31+
</div>
32+
2133
</div>
2234

2335
<mat-form-field appearance="outline">

src/app/create-course/create-course.component.ts

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export class CreateCourseComponent implements OnInit {
1919

2020
courseId:string;
2121

22+
percentageChanges$: Observable<number>;
23+
24+
2225
form = this.fb.group({
2326
description: ['', Validators.required],
2427
category: ["BEGINNER", Validators.required],
@@ -48,6 +51,9 @@ export class CreateCourseComponent implements OnInit {
4851
cacheControl: "max-age=2592000,public"
4952
})
5053

54+
this.percentageChanges$ = task.percentageChanges();
55+
56+
5157
task.snapshotChanges().subscribe();
5258

5359

0 commit comments

Comments
 (0)