From the course: Building Angular and ASP.NET Web API Apps
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Adding pagination
From the course: Building Angular and ASP.NET Web API Apps
Adding pagination
- On this part, we are going to add pagination to our angular application. So for that, let us start by first importing the necessary module. Let us go to the app.module.ts file. In the app.module.ts file, scroll down to the material design section. And in here, let us import the MatPaginatorModule. We imported the module. For us to be able to use this module, let us include it in our imports array. So after the MatSortModule, paste the MatPaginatorModule. Now let us go to the entries.component.html file. And in here, scroll down to the bottom of this page. After the table, we are going to create the placeholder for the paginator. So for that, let us write in here mat-paginator and then let us define the properties. The first property is going to be length. And the length is going to be 100. Next, let us define the page size, which is going to be 10. And then at the end, let us define the page size options. The page size options will be used to generate the drop down for the number of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.