reference: AngularFireStorageReference;
task: AngularFireUploadTask;
uploadState: Observable<string>;
uploadProgress: Observable<number>;
downloadLink: Observable<string>;
beginUpload(event) {
const id = Math.floor(Math.random() * 1000);
this.reference = this.afStorage.ref(id);
this.task = this.reference.put(event.target.files[0]);
this.uploadState = this.task.snapshotChanges().pipe(map(s => s.state));
this.uploadProgress = this.task.percentageChanges();
this.downloadLink = this.task.getDownloadURL();
}
Above example is sourced from tutorial.
I am trying to retrieve the download link after successful upload to firebase storage, but encountering this error:
TS2740: Type 'Subscription' is missing the following properties from type 'Observable': _isScalar, source, operator, lift, and 6 more.