There is an Observable called this.downloadURL that retrieves a specific string value after querying the database:
https://i.sstatic.net/pWmVk.jpg
The goal is to obtain this value in the following method:
//Upload a new picture to the database as a profile picture
uploadBetPicture(event) {
const id =
"bet_" +
Math.random()
.toString(36)
.substring(2) +
"_Photo";
this.ref = this.afStorage.ref(id);
this.task = this.ref.put(event.target.files[0]);
this.downloadURL = this.task.downloadURL();
//Above code successfully stores the picture and sets the observable
//The error occurs at this line
this.photoUrl = this.downloadURL.value;
}
Despite seeing the value in the console, attempting to access it results in an error message:
Property 'value' does not exist on type 'Observable'.
It's important to note that the storing process functions correctly since the value can be retrieved.