Skip to content

Commit 35933d0

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

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/app/app-routing.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const routes: Routes = [
2828
{
2929
path: 'create-course',
3030
component: CreateCourseComponent,
31-
canActivate: [AngularFireAuthGuard],
31+
//canActivate: [AngularFireAuthGuard],
3232
data: {
3333
authGuardPipe: adminOnly
3434
}

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

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ export class CreateCourseComponent implements OnInit {
4242

4343
console.log(file.name);
4444

45+
const filePath = `courses/${this.courseId}/${file.name}`;
46+
47+
const task = this.storage.upload(filePath, file, {
48+
cacheControl: "max-age=2592000,public"
49+
})
50+
51+
task.snapshotChanges().subscribe();
52+
4553

4654
}
4755

src/environments/environment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
export const environment = {
66
production: false,
7-
useEmulators: true,
7+
useEmulators: false,
88
firebase: {
99
apiKey: "AIzaSyB9LOREMGhj1jpVXOHTKIwQu2oM7pVfjQg",
1010
authDomain: "fir-course-recording-c7f3e.firebaseapp.com",

0 commit comments

Comments
 (0)