【问题标题】:AngularFire get count of child dataAngularFire获取子数据的计数
【发布时间】: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

【问题讨论】:

标签: angularjs firebase angularfire


【解决方案1】:

试试

profile.$loaded.then(function(data) {
    console.log(data);
}); 

看看这里的第一条评论 post

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-22
    • 2017-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-14
    相关资源
    最近更新 更多