Tôi đang cố gắng hiển thị hình ảnh từ firebase thành html img
thẻ nhưng không thể truy xuất hình ảnh.Hiển thị hình ảnh từ bộ nhớ firebase trong thẻ html img
mã Javascript:
var storageRef = firebase.storage().ref();
var spaceRef = storageRef.child('images/photo_1.png');
var path = spaceRef.fullPath;
var gsReference = storage.refFromURL('gs://test.appspot.com')
storageRef.child('images/photo_1.png').getDownloadURL().then(function(url) {
var test = url;
}).catch(function(error) {
});
mã html:
<img src="test" height="125" width="50"/>
img src thuộc tính của bạn có chứa chuỗi ' "thử nghiệm"' như URL, nó không chứa nội dung của biến thử nghiệm –