0
我似乎無法獲得基於文件名的存儲器中的圖像的下載URL。Ionic 2 Firebase從存儲器中獲取圖像URL
糾正,我可以,但我似乎無法得到變量功能。例如。我的代碼:
public getVenueImage(image: string){
let imgUrl: string;
try{
this.firebase.storage().ref().child("/venues/" + image).getDownloadURL().then(function(url){
imgUrl = url;
console.log("log1: " + url);
});
}
catch(e){
console.log(e);
}
console.log("log2: " + imgUrl);
return imgUrl;
}
的log 2:未定義
任何原因,我不能讓圖像鏈接返回?