0
私はストレートFirebaseのドキュメントからこのコードを持っている:FirebaseのストレージからイメージのURLを取得する方法は?
// Create a reference to the file we want to download
var user = firebase.auth().currentUser.uid;
var storageRef = firebase.storage();
var pathReference = storageRef.ref('/' + user + '/profilePicture/' + image.name);
//var starsRef = storageRef.child('/' + user + '/profilePicture/' + file.name);
// Get the download URL
pathReference.getDownloadURL().then(function(url) {
// Insert url into an <img> tag to "download"
$scope.imageUrl = url;
console.log($scope.imageUrl);
});
しかし、私は示す画像...任意の助けを得るために私のhtmlファイルに書き込むために何を把握することはできませんか?
こんにちは、あなたの助けをありがとう、それは私の絵の周りのCSSを表示するが、絵自体は**ありません**表示中(まだ)。 imageUrlでconsole.logを試してみたところ、nothingsも表示されます。何が原因だろうか? – FrenchyNYC
デバッグしようとしているのは、imageUrlではなく 'console.log(url)'です。 imageUrlをデバッグしたい場合は、 'console.log($ scope.imageUrl)'を実行してください。 – e666
私はストレージを参照するのを忘れていました。今私が最後の問題は、 "ファイル"が定義されていないということです。どのように私はこのデータを持つことができますか? それ以外はすべて動作します;) – FrenchyNYC