Scroll 使用Ionic 3 Firestore和Observable进行分页

Scroll 使用Ionic 3 Firestore和Observable进行分页,scroll,pagination,ionic3,observable,google-cloud-firestore,Scroll,Pagination,Ionic3,Observable,Google Cloud Firestore,我不知道如何为下面的场景进行分页。请让我知道是否有一个更简单的方法,我是复杂的。它使用离子3和firestore show.html <ion-row *ngFor="let item of observable | async"> {{item.value}} </ion-row> <ion-infinite-scroll (ionInfinite)="doInfinite($event)"> <ion-infinite-scroll-con

我不知道如何为下面的场景进行分页。请让我知道是否有一个更简单的方法,我是复杂的。它使用离子3和firestore

show.html

<ion-row *ngFor="let item of observable | async">
{{item.value}}
</ion-row>

<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
    <ion-infinite-scroll-content></ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
因此,我从provider.ts调用了一个方法,以获取在show.ts文件中可以观察到的集合列表。可观察对象将通过
async
管道显示在show.html中

为了对firestore进行分页,我必须使用
startAt(dataSnap)
startAfter(dataSnap)
。要使用这些方法,我需要集合的最后一个数据快照。如何从一个可观察的对象中获取最后一项? 你知道如何继续使用这种方法吗

observable: Observable<any[]>;

this.observable = this.provider.getData();  //in the corstructor method
getData(){
return this.afs.collection('data').limit(10).snapshotChanges().map(a=>{
        return a.map(x=> {
          return {
            value: x.payload.doc.data(),
          };
        });
      });
  }