Ember pagination jsonp callback api


#1

Stackoverflow Discussion

I have an API example.com/api/v1 and when navigate to example.com/api/v1/items

I got json data below.

[{
   "id":"1",
   "title":"Lorem ipsum dolor sit amet",
   "link":"/api/v1/items/1"
},
{
   "id":"2",
   "title":"consectetur adipisicing elit",
   "link":"/api/v1/items/2"
},
{
   "id":"3",
   "title":"sed do eiusmod tempor incididunt",
   "link":"/api/v1/items/3"
}]
.
.
.

This api accept parameter offset, count, and callback.

Ex: example.com/api/v1/items?count=10 I will get

[{
   "id":"1",
   "title":"Lorem ipsum dolor sit amet",
   "link":"/api/v1/items/1"
},
.
.
.
{
   "id":"10",
   "title":"consectetur adipisicing elit",
   "link":"/api/v1/items/10"
}]

Ex: example.com/api/v1/items?count=10&offset=10 I will get

[{
   "id":"11",
   "title":"Lorem ipsum dolor sit amet",
   "link":"/api/v1/items/11"
},
.
.
.
{
   "id":"20",
   "title":"consectetur adipisicing elit",
   "link":"/api/v1/items/20"
}]

How to implement pagination with ember?

Thanks for your time.