MCPcopy Create free account
hub / github.com/angular/components / _pageData

Method _pageData

src/material/table/table-data-source.ts:339–346  ·  view source on GitHub ↗

* Returns a paged slice of the provided data array according to the provided paginator's page * index and length. If there is no paginator provided, returns the data array as provided.

(data: T[])

Source from the content-addressed store, hash-verified

337 * index and length. If there is no paginator provided, returns the data array as provided.
338 */
339 _pageData(data: T[]): T[] {
340 if (!this.paginator) {
341 return data;
342 }
343
344 const startIndex = this.paginator.pageIndex * this.paginator.pageSize;
345 return data.slice(startIndex, startIndex + this.paginator.pageSize);
346 }
347
348 /**
349 * Updates the paginator to reflect the length of the filtered data, and makes sure that the page

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected