From the course: Angular: Material Design

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Pagination

Pagination - Angular Tutorial

From the course: Angular: Material Design

Start my 1-month free trial

Pagination

- [Instructor] Suppose you have a lot of data, like too much to show in a single page or data table. Well, pagination allows users to browse page chunks of your data. Although techniques like infinite scrolling are popular, one advantage of pagination is you have more control over the page size. If you're not careful, an infinite scroll can eat up a lot of memory. It's good practice to let users select the number of records they'd like to see on a page and then give them forward and backward links to move between pages. The server has the responsibility of loading the data for the selected page. We don't want to send too much data from the API. Let's add pagination to our orders table now. Returning to Visual Studio, let's command-P and open the orders.modules.ts file, and let's go ahead and add the paginator on line 16, import the MatPaginatorModule from @angular/material/paginator. And I'll go ahead and copy that module name from 16 and we'll go down to where we import. And I'm…

Contents