我想使用angularfire2
将子节点中的数据作为Object检索 getPostEditData(uid:any,key:any){
this.dataObject = this.af.database.object('/webPosts/'+uid+key) as
FirebaseObjectObservable<postVal>
return this.dataObject; }
我用过这个,但它不起作用。我怎么想这样做? My Structure
答案 0 :(得分:2)
您的参考需要另一个斜杠(/
)。
getPostEditData(uid:any,key:any) {
this.dataObject =
this.af.database.object('/webPosts/' + uid + '/' + key) as FirebaseObjectObservable<postVal>
return this.dataObject;
}
错误:uid + key
右:uid + '/' + key