-1

downloadurl not coming out in console, instead [object,Object] [screenshot image]1

this.dbs.collection("databases").get().toPromise().then((snapshot) => {
  snapshot.docs.forEach(doc=>{ 
    let name=doc.data().path;
    this.down=this.storage.ref(name).getDownloadURL();
    console.log(name);
    console.log(this.down);
  })
ASYRAF
  • 13
  • 4

1 Answers1

0

If you look at the documentation, getDownloadURL() returns a promise, so you'll need to wait for that promise to resolve before attempting to access it:

this.storage.ref(name).getDownloadURL().then((link) => {
  this.down = link;
}
Richard
  • 951
  • 7
  • 14