Closed bogdantmm92 closed 9 years ago
Create the normalized ref first and pass it into the Scroll/Paginate classes.
I did this:
// map the paths we are going to join
var norm = new Firebase.util.NormalizedCollection(
FB.child('sessions'),
[FB.child('accounts'), 'accounts', 'sessions.user']
);
// specify the fields for each path
norm = norm.select( 'sessions.user', 'sessions.loginTime', 'sessions._sort', ... );
// get a reference we can use like a normal Firebase instance
var scrollRef = new Firebase.util.Scroll(norm.ref(), '_sort');
The initial data is loaded correctly, but no subsequent data is loaded on scroll. Infinite scrolling does work when I replace the Normalized Collection ref to a standard Firebase ref. What am I doing wrong here?
firebase#2.2.9 firebase-util#0.2.6
This is not exactly an issue, but more of a question. I have these lines:
I want to be able to paginate through the normalized ref. Any idea how to structure the refs? If I try to compose the scrollRef out of normalizedRef, it gives me this error: First argument to Firebase.util.Scroll must be a valid Firebase ref. It cannot be a Query (e.g. you have called orderByChild()).