I am making a request to my feed api endpoint to fetch data in ember store.It is working fine but now I want to make an another call in action and append the fetched data to store data.
route.js
import Ember from 'ember';
export default Ember.Route.extend({
model(){
var inflector = Ember.Inflector.inflector;
inflector.uncountable('feed');
inflector.uncountable('profile'),
return Ember.RSVP.hash({
feed:this.store.query('feed',{start:0,end:5}),
profile:this.store.queryRecord('profile',{target:-1}),
});
}
}
});
I want that when I scroll down the page and its reaches the end of the page.It should again make a request for feed with start as 6 and end as 10.And the result should get appended to the data present in the store.I am trying to implement the pagination here.My endpoint doesn't serve with meta object which contains total page.The api in not standard.How should I achieve this? Please gives some code or tutorial.Thanks in adavnce.
Aucun commentaire:
Enregistrer un commentaire