Lucas Andrade
Lucas Andrade

Reputation: 4610

Angular 2 get N objects from backend (API)

I already know how to get elements from my API, but I need to work with 67000 objects and it's take a long time to loading the page. Size I am display this objects in a table I would like to know how to get only the first 10 objects from my API json, than when user go to next page I will load the next 10 objects.

I don't want to load all objects, I want to load ten objects at the first page, and when user click on page 4 I will load only the objects 30, 31, 32 ... 40. I would like to know if there is any http request like get_objetcs_in_range(30, 40) something like that

Upvotes: 0

Views: 379

Answers (1)

Anonguy123
Anonguy123

Reputation: 417

What are you using for your backend? Check out pagination that way when your API only returns N amount of items instead of requesting all on the frontend and only loading 10 at a time

Upvotes: 1

Related Questions