I have data structure like below as Firebase suggested it.
{
links: {
link1: {
title: "Example",
href: "http://example.org",
submitted: "user1",
comments: {
comment1: true
comment2:true
}
}
}
comments:{
comment1:{
text: hi im comment1
}
comment2:{
text:hi im comment 2
}
}
}
This Article have told how to lookup data structured like this. but that was pure Firebase SDK related. How we can do lookups in AngularFire?
Sync data to firebase is essential for me. I know $firebaseArray()
syncs data automatically. But I facing trouble when I need to sync Comments?
Below is code from Controller
var ref = firebase.database().ref("links");
$scope.links = $firebaseArray(ref);
and here is my HTML
<div ng-repeat="link in links">
<p>{{link.title}}</p>
<p>{{link.href}}</p>
<p>{{link.comments}}</p> ////////// how I can get comment from here I have
/////only Ids of comment. how I can get link comment
</div>