0

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>
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Zaid Mirza
  • 3,540
  • 2
  • 24
  • 40
  • 1
    See http://stackoverflow.com/questions/30299972/joining-data-between-paths-based-on-id-using-angularfire – Frank van Puffelen Oct 21 '16 at 21:20
  • @FrankvanPuffelen I have checked,Kato has told two methods, which one is better? `$extend` or `Firebase-util`? is `Firebase util` is officially supported Lib by `Firebase`? and both the methods will support implicit sync? – Zaid Mirza Oct 22 '16 at 04:52

0 Answers0