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
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PaginationService(
nestService,responseStrategy,options?):PaginationService
Defined in: src/lib/services/pagination.service.ts:31
Parameters
Section titled “Parameters”nestService
Section titled “nestService”NestService
responseStrategy
Section titled “responseStrategy”options?
Section titled “options?”ResponseOptions = ...
Returns
Section titled “Returns”PaginationService
Methods
Section titled “Methods”paginate()
Section titled “paginate()”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.
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Parameters
Section titled “Parameters”response
Section titled “response”The raw API response body. For drivers that emit a bare array (PostgREST), pass the array.
headers?
Section titled “headers?”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>.
Returns
Section titled “Returns”A typed PaginatedCollection instance
Remarks
Section titled “Remarks”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.