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
Type Parameters
Section titled “Type Parameters”T extends IPaginatedObject
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”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
Parameters
Section titled “Parameters”T[]
number
number
number
total?
Section titled “total?”number
perPage?
Section titled “perPage?”number
prevPageUrl?
Section titled “prevPageUrl?”string
nextPageUrl?
Section titled “nextPageUrl?”string
lastPage?
Section titled “lastPage?”number
firstPageUrl?
Section titled “firstPageUrl?”string
lastPageUrl?
Section titled “lastPageUrl?”string
Returns
Section titled “Returns”PaginatedCollection<T>
Properties
Section titled “Properties”data:
T[]
Defined in: src/lib/models/paginated-collection.ts:7
firstPageUrl?
Section titled “firstPageUrl?”
readonlyoptionalfirstPageUrl?:string
Defined in: src/lib/models/paginated-collection.ts:16
readonlyoptionalfrom?:number
Defined in: src/lib/models/paginated-collection.ts:9
lastPage?
Section titled “lastPage?”
readonlyoptionallastPage?:number
Defined in: src/lib/models/paginated-collection.ts:15
lastPageUrl?
Section titled “lastPageUrl?”
readonlyoptionallastPageUrl?:string
Defined in: src/lib/models/paginated-collection.ts:17
nextPageUrl?
Section titled “nextPageUrl?”
readonlyoptionalnextPageUrl?:string
Defined in: src/lib/models/paginated-collection.ts:14
readonlypage:number
Defined in: src/lib/models/paginated-collection.ts:8
perPage?
Section titled “perPage?”
readonlyoptionalperPage?:number
Defined in: src/lib/models/paginated-collection.ts:12
prevPageUrl?
Section titled “prevPageUrl?”
readonlyoptionalprevPageUrl?:string
Defined in: src/lib/models/paginated-collection.ts:13
readonlyoptionalto?:number
Defined in: src/lib/models/paginated-collection.ts:10
total?
Section titled “total?”
readonlyoptionaltotal?:number
Defined in: src/lib/models/paginated-collection.ts:11
Methods
Section titled “Methods”normalize()
Section titled “normalize()”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
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”INormalized
[]
Throws
Section titled “Throws”KeyNotFoundItem