Reputation: 1780
I want to retrieve data in child node as a Object using angularfire2
getPostEditData(uid:any,key:any){
this.dataObject = this.af.database.object('/webPosts/'+uid+key) as
FirebaseObjectObservable<postVal>
return this.dataObject; }
I used this but its not working. How I suppose to do that? My Structure
Upvotes: 0
Views: 494
Reputation: 7947
You need another slash (/
) with your reference.
getPostEditData(uid:any,key:any) {
this.dataObject =
this.af.database.object('/webPosts/' + uid + '/' + key) as FirebaseObjectObservable<postVal>
return this.dataObject;
}
Wrong: uid + key
Right: uid + '/' + key
Upvotes: 2