Skip to content

Instantly share code, notes, and snippets.

@joel-daros
Created September 10, 2018 14:00
Show Gist options
  • Save joel-daros/b9922b86712985bfb57a31440156609e to your computer and use it in GitHub Desktop.
Save joel-daros/b9922b86712985bfb57a31440156609e to your computer and use it in GitHub Desktop.
Angularfire file upload
upload(path: string, file: File)
const storageRef = this._storage.ref(path);
const task = this._storage.upload(path, file);
return from(task).pipe(
switchMap((task: UploadTaskSnapshot) => storageRef.getDownloadURL())
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment