From ce818ec4c4a1e7103e25e98ac24bfe41b31e486a Mon Sep 17 00:00:00 2001 From: Rahul Raveendran Date: Sun, 10 Mar 2019 16:46:50 +0530 Subject: [PATCH 1/2] import of finalize and fileref is missing --- src/app/file-upload/file-upload.component.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/file-upload/file-upload.component.ts b/src/app/file-upload/file-upload.component.ts index f50e245..294a51d 100644 --- a/src/app/file-upload/file-upload.component.ts +++ b/src/app/file-upload/file-upload.component.ts @@ -3,6 +3,7 @@ import { AngularFireStorage, AngularFireUploadTask } from 'angularfire2/storage' import { AngularFirestore } from 'angularfire2/firestore'; import { Observable } from 'rxjs/Observable'; import { tap } from 'rxjs/operators'; +import { finalize } from 'rxjs/operators'; @Component({ @@ -46,6 +47,9 @@ export class FileUploadComponent { // The storage path const path = `test/${new Date().getTime()}_${file.name}`; + + // file reference + const fileRef = this.storage.ref(path); // Totally optional metadata const customMetadata = { app: 'My AngularFire-powered PWA!' }; From ff1a61788f9615aa1cf8e9c0049c3a296ed4c66f Mon Sep 17 00:00:00 2001 From: Rahul Raveendran Date: Sun, 10 Mar 2019 16:56:52 +0530 Subject: [PATCH 2/2] removed multiple operator import --- src/app/file-upload/file-upload.component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/file-upload/file-upload.component.ts b/src/app/file-upload/file-upload.component.ts index 294a51d..4a574c7 100644 --- a/src/app/file-upload/file-upload.component.ts +++ b/src/app/file-upload/file-upload.component.ts @@ -2,8 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AngularFireStorage, AngularFireUploadTask } from 'angularfire2/storage'; import { AngularFirestore } from 'angularfire2/firestore'; import { Observable } from 'rxjs/Observable'; -import { tap } from 'rxjs/operators'; -import { finalize } from 'rxjs/operators'; +import { tap, finalize } from 'rxjs/operators'; @Component({