【发布时间】:2014-10-31 08:17:31
【问题描述】:
我想计算我的 Firebase 中用户个人资料中的总数据。因此,我首先将配置文件作为对象:
var profile = $firebase(ref.child('profile').child(userId)).$asObject();
现在如果我 console.log 这个变量有这个对象:
我找到了一些计算对象的解决方案
console.log(Object.keys(profile));
但这只给我计数 3。总是:
任何人有一个解决方案,我可以得到存储数据的计数吗? 应该有年龄、性别、地点、实名、用户名=5
【问题讨论】:
-
试试 profile.$loaded.then(function(data) {console.log(data);});
-
你摇滚。谢谢。将此作为答案发布并稍作解释,以便我接受;)
标签: angularjs firebase angularfire