Created
June 26, 2020 04:59
-
-
Save peterkracik/e9d75d4d0717e76052b4234a89a2ba6c to your computer and use it in GitHub Desktop.
Retrieving download url from Firebase Storage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AngularFireStorage } from '@angular/fire/storage'; | |
| class MyClass { | |
| constructor(private storage: AngularFireStorage) {} | |
| public async getUrl(filepath: string) { | |
| this.storage.ref(filePath) | |
| .getDownloadURL() // it returns url value as observable | |
| .subscribe((url: string) => { | |
| // actions with url value | |
| }) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment