1

I'm using Firebase utils infinite scroll to be able to load "x" number of items instead of all of them to avoid performance issues in ng-repeat later. I am displaying the first 20 users and so far everything works well but now I am facing the next problem.

I need to load data from a different node in firebase in the ng-repeat I have using infinite scroll. Hope this is understandable. Gonna explain by code better.

Let's say I have this in my controller:

var listusers = new Firebase(FURL + "/Users/" + city);
$scope.scrollItems = $scrollArray(listusers, 'Reverse');

And in the factory:

return function(ref, field) {

      var scrollRef = new Firebase.util.Scroll(ref, field);

      var list = $firebaseArray(scrollRef);

      list.scroll = scrollRef.scroll;
      scrollRef.scroll.next(20);
      return list;
    }

Then in the view I load the data with ng-repeat to show some data such as: name, date, profile picture, etc.

ng-repeat="user in filtereusers = (scrollItems | filter:category) | track by user.$id"

Now the thing is that on each item in ng-repeat I want to load more data but from a different node, as users are located in myapp.firebaseio.com/Users/ I need to load more data from myapp.firebaseio.com/Score both sharing the user Id.

How can I achieve this using Firebase utils infinite scroll?? any idea or am I doing something wrong?

Thanks in advance

Daniel Soublett
  • 849
  • 2
  • 8
  • 23

0 Answers0