angular - DownloadURL return null in below code -


when change file updated in firebase storage when try downloadurl show null.

filechange(event: any) {     const imagefolder: string = this.employee.id;     const filelist: filelist = event.target.files;     const file: file = filelist[0];     const storageref = firebase.storage().ref().child(`${imagefolder}/profile.jpg`).put(file);     console.log(storageref.snapshot.downloadurl); } 

the put() asynchronous. if want url after file uploaded have this:

firebase.storage().ref().child(`${imagefolder}/profile.jpg`).put(file).then((snapshot) => {      storageref  = snapshot.downloadurl:      console.log(snapshot.downloadurl); }); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -