Data table with pagination

We have created the scaffolding to lay out our master/detail view. In the master outlet, we will have a paginated data table of users, so let's implement UserTableComponent, which will contain a MatTableDataSource property named dataSource. We will need to be able to fetch user data in bulk using standard pagination controls like pageSize and pagesToSkip and be able to further narrow down the selection with user provided searchText.

Let's start by adding the necessary functionality to the UserService.

  1. Implement a new interface IUsers to describe the data structure of paginated data
src/app/user/user/user.service.ts...export interface IUsers {  items: IUser[]  total: number}
  1. Add getUsers to UserService
src/app/user/user/user.service.ts ...

Get Building Large-Scale Web Applications with Angular now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.