I am using pagination. On ngOnInit()
, it is fetching data with proper ordering as expected, see code below -
this.firestore.collection('complaints' , ref => ref
.where("complaint_status", "==", "Open")
.limit(8)
.orderBy('ticketid', 'desc')
).snapshotChanges()
.subscribe(response => {
But whenI try to use this on clicking NextPage()
function using below code, I dont receive any result
nextPage(){
console.log("show next. data");
this.disable_next = true;
this.firestore.collection('complaints', ref => ref
.where("complaint_status", "==", "Open")
.limit(8)
.orderBy('ticketid', 'desc')
.startAfter(this.lastInResponse)
).get()
Why am I not getting any result here? Note that if I remove order by, I do get results, but not getting with it on nextpage function.