Skip to content
qubeejs/angular
3.8/API/PaginatedCollection

PaginatedCollection

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

Defined in: src/lib/models/paginated-collection.ts:5

T extends IPaginatedObject

new PaginatedCollection<T>(data, page, from?, to?, total?, perPage?, prevPageUrl?, nextPageUrl?, lastPage?, firstPageUrl?, lastPageUrl?): PaginatedCollection<T>

Defined in: src/lib/models/paginated-collection.ts:6

T[]

number

number

number

number

number

string

string

number

string

string

PaginatedCollection<T>

data: T[]

Defined in: src/lib/models/paginated-collection.ts:7


readonly optional firstPageUrl?: string

Defined in: src/lib/models/paginated-collection.ts:16


readonly optional from?: number

Defined in: src/lib/models/paginated-collection.ts:9


readonly optional lastPage?: number

Defined in: src/lib/models/paginated-collection.ts:15


readonly optional lastPageUrl?: string

Defined in: src/lib/models/paginated-collection.ts:17


readonly optional nextPageUrl?: string

Defined in: src/lib/models/paginated-collection.ts:14


readonly page: number

Defined in: src/lib/models/paginated-collection.ts:8


readonly optional perPage?: number

Defined in: src/lib/models/paginated-collection.ts:12


readonly optional prevPageUrl?: string

Defined in: src/lib/models/paginated-collection.ts:13


readonly optional to?: number

Defined in: src/lib/models/paginated-collection.ts:10


readonly optional total?: number

Defined in: src/lib/models/paginated-collection.ts:11

normalize(id?): INormalized

Defined in: src/lib/models/paginated-collection.ts:35

Normalize the collection to a paginated list of ids for state-managed applications.

This method returns a single key object, where the key is the page number and the associated value is an array of ids. Each id is fetched by the collection items, looking up for the “id” key. If an id is supplied to this method, it will be used instead of the default “id” key.

Please note that in case the key doesn’t exist in the collection’s item, a KeyNotFoundError is thrown

string

INormalized

[]

KeyNotFoundItem