Skip to content

Issue with $key in fb-util infinite scroll #13

Description

@md-rashid

I am using the infinite scroll and everything looks good. However, once I hit the 250 elements, I am seeing the following error. Any idea what this is about ?

Error:
Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().
at Jh (https://www.gstatic.com/firebasejs/3.2.1/firebase.js:431:117)
at X.g.Nd (https://www.gstatic.com/firebasejs/3.2.1/firebase.js:441:298)
at r._grow (https://<>/content/script/firebase-util.min.js:10:8979)
at r._listen (https://<>/content/script/firebase-util.min.js:10:10961)
at r.goTo (https://<>/content/script/firebase-util.min.js:10:8062)
at r.moveTo (https://<>/content/script/firebase-util.min.js:10:3672)
at r.next (https://<>/content/script/firebase-util.min.js:10:17083)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:198:424
at xa.(anonymous function) (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:59:133)
at l.$eval (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js:126:84)

Code:
var baseRef = firebase.database().ref().child(refPath);
var scrollRef = new firebase.util.Scroll(baseRef, '$key');
scrollRef.scroll.next(25);
var list = $firebaseArray(scrollRef);
list.scroll = scrollRef.scroll;

Front-end code:
"div infinite-scroll="vm.products.scroll.next(10)" infinite-scroll-distance="1""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions