Skip to content

Commit b887ffc

Browse files
author
Your Name
committed
Firebase & AngularFire In Depth
1 parent 3f38d76 commit b887ffc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ <h3>Create New Course</h3>
1616

1717
<img class="course-thumbnail mat-elevation-z3">
1818

19+
<input type="file" (change)="uploadThumbnail($event)">
20+
1921
</div>
2022

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

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,20 @@ export class CreateCourseComponent implements OnInit {
3131
constructor(private fb:FormBuilder,
3232
private coursesService:CoursesService,
3333
private afs: AngularFirestore,
34-
private router: Router) {
34+
private router: Router,
35+
private storage: AngularFireStorage) {
3536

3637
}
3738

39+
uploadThumbnail(event) {
40+
41+
const file:File = event.target.files[0];
42+
43+
console.log(file.name);
44+
45+
46+
}
47+
3848
ngOnInit() {
3949
this.courseId = this.afs.createId();
4050
}

0 commit comments

Comments
 (0)