We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export default Ember.Route.extend(InfinityRoute, { perPageParam: "limit", pageParam: "page", model() { this.store.unloadAll('post'); return RSVP.hash({ posts: this.infinityModel("post", {perPage: 2, startingPage: 1}), }); }, setupController(controller, models) { controller.setProperties(models); }, });
and in the template
{{#each posts as |post|}} {{post.content}} {{/each}} {{infinity-loader infinityModel=posts}}
Will load the first page, but then doesn't attempt to load anything else. No errors in the console, and no requests to the backend server.
However everything works if I use a standard
model() { return this.infinityModel("post", { perPage: 12, startingPage: 1 }); }
The response from the server looks like this
{ "data": [ { "type": "post", "id": "58234f35835a3e49843a245a", "attributes": { //removed }, "relationships": { "account": { "data": { "type": "accounts", "id": "5822dc39835a3e252019c9be" } } } }, { "type": "post", "id": "5822e491835a3e49843a00b3", "attributes": { //removed }, "relationships": { "account": { "data": { "type": "accounts", "id": "5822dc39835a3e252019c9be" } } } } ], "meta": { "total_pages": "54" }, "links": { "next": { "href": "http://localhost:8080/api/posts/page?limit=2&page=4" }, "self": { "href": "http://localhost:8080/api/posts/page?limit=2&page=3" }, "last": { "href": "http://localhost:8080/api/posts/page?limit=2&page=54" }, "first": { "href": "http://localhost:8080/api/posts/page?limit=2&page=0" }, "prev": { "href": "http://localhost:8080/api/posts/page?limit=2&page=2" } } }
Am I missing something here?
The text was updated successfully, but these errors were encountered:
hi @peavers !
In your above setup, your "infinity model" lives on your controller as controller.posts. Try
controller.posts
this.infinityModel("post", {perPage: 2, startingPage: 1, modelPath: 'controller.posts'})
Sorry, something went wrong.
Nailed it! Thanks champ
No branches or pull requests
and in the template
Will load the first page, but then doesn't attempt to load anything else. No errors in the console, and no requests to the backend server.
However everything works if I use a standard
The response from the server looks like this
Am I missing something here?
The text was updated successfully, but these errors were encountered: