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:未定义
任何原因,我不能让图像链接返回?