【发布时间】:2016-05-09 09:13:40
【问题描述】:
目前我有一个硬编码的 url 数组,用于接收 html 中的图像。
$scope.product = {
"images" : [
{"image": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/194929/colorburst-700x700.jpg"},
{"image": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/194929/colorburst-700x700.jpg"},
{"image": "https://s3-us-west-2.amazonaws.com/s.cdpn.io/194929/colorburst-700x700.jpg"}
] };
我刚刚学会了如何从数据库中接收数据,但是如何将结果存储在 json 数组中,就像“$scope.product”中显示的那样
我目前正在通过
接收数据// Get a reference to our posts
var ref = new Firebase("https://<database>.firebaseio.com/profile");
// Retrieve new posts as they are added to our database
ref.on("child_added", function(snapshot, prevChildKey) {
var newPost = snapshot.val();
debugger;
console.log("The email is: " + newPost.email);
});
【问题讨论】:
标签: javascript html firebase firebase-realtime-database