Skip to content
qubeejs/angular
3.8/API/PaginationService

PaginationService

ArchivedThese are the docs for ng-qubee 3.8. Read the 4.0 docs for @qubeejs/angular.

Defined in: src/lib/services/pagination.service.ts:12

new PaginationService(nestService, responseStrategy, options?): PaginationService

Defined in: src/lib/services/pagination.service.ts:31

NestService

IResponseStrategy

ResponseOptions = ...

PaginationService

paginate<T>(response, headers?): PaginatedCollection<T>

Defined in: src/lib/services/pagination.service.ts:63

Transform a raw API response into a typed PaginatedCollection

Delegates to the active driver’s response strategy for parsing, then auto-syncs the parsed page and lastPage back into NestService so pagination navigation helpers on NgQubeeService can operate against the live server-reported bounds without consumer bookkeeping.

T extends IPaginatedObject

The raw API response body. For drivers that emit a bare array (PostgREST), pass the array.

HeaderBag

Optional HTTP response headers. Required by the PostgREST driver (reads Content-Range for pagination metadata); body-only drivers ignore it. Accepts Angular’s HttpHeaders, the native Headers class, or a plain Record<string, string>.

PaginatedCollection<T>

A typed PaginatedCollection instance

lastPage is only synced when the response yields a positive integer. Server-emitted 0 (empty collection edge case) and absent fields are treated as “no useful info” and leave isLastPageKnown: false.