【发布时间】:2018-07-21 12:17:23
【问题描述】:
我想访问我的 firebase 数据库中的特定节点。
我实际上运行的是:
- “angularfire2”:“^5.0.0-rc.4”,
- “火力基地”:“^4.9.0”,
我的组件中的代码如下所示:
this.id = this.route.snapshot.paramMap.get('id');
auth.appUser$.subscribe(appUser => this.appUser = appUser );
if (this.id)
{
//Live game state info
this.subscription = this.gameService.getLive(this.id).subscribe(action => {
this.game = action.payload.val();
console.log(this.game);
});
}
}
我在 gameService 中调用的函数如下所示:
getLive(gameId)
{
return this.db.object('/games/live/' + gameId).snapshotChanges();
}
问题是我不知道如何在回合中访问节点“StartedAt”。但是我可以从我的实际“游戏”中看到所有完整的节点:
如何从特定回合访问“startedAt”?
【问题讨论】:
标签: angular typescript firebase firebase-realtime-database angularfire2