I'm trying to implement an Angular material table with pagination, that is connected to the backend, that retrieves data from Azure Table Storage.
I know, that Table Storage supports ExecuteQuerySegmentedAsync, which returns TableContinuationToken. It looks fine. So on the frontend, I get something like this:
interface IPagedResult<T> {
items: T[];
isFinalPage: boolean;
continuationToken: string;
}
interface ILog {
enqueuedDate: string;
...
}
Somewhere in component.ts:
private logsTableSource: MatTableDataSource<ILog>;
@ViewChild(MatPaginator)paginator: MatPaginator;
ngAfterViewInit() {
myService.GetRecords(this.paginator.pageSize)
.subscribe(
(res: IPagedResult<ILog>) => {
this.logsTableSource = new MatTableDataSource<ILog>(res.items);
});
}
Now I'm wondering, how to get the number of pages? And let the server know what specific page I want?
continuationToken
looks like this:
In fact, what I can do with this continuationToken?