Data not showing in view after moving to Ember 3.0
See original GitHub issueMy route for a remote paginated API stopped working when I upgraded to Ember 3.0 today. Ember Inspector shows data is loading, but it doesn’t display in the view. Pagination links also show up and load data, but the table that should show the data stays empty.
One error I get is: “DEPRECATION: Usage of content
is deprecated, use model
instead. [deprecation id: ember-runtime.controller.content-alias]”. Maybe this is relevant since I believe 3.0 removes some deprecated things?
Here’s the relevant stuff from my route:
model: function(params) {
params.paramMapping = {
page: "page[number]",
perPage: "page[size]",
total_pages: "total_pages"
};
return this.findPaged('user', params);
},
perPage: 30,
queryParams: {
sort: { replace: true, refreshModel: true },
search: { replace: true, refreshModel: true },
filter: { replace: true, refreshModel: true }
}
Here’s the pagination stuff in my controller:
queryParams: ['page', 'perPage', 'sort', 'filter', 'search'],
Here’s how I’m using it in my template:
{{#each model as |user|}}
{{user.username}}
{{/each}}
{{page-numbers content=model}}
Also, if I just put {{model}}
in my template I get <(unknown mixin):ember526>
. On other routes this is normally something like <DS.RecordArray:ember480>
, but maybe this is just how the pagination works.
Am I doing something wrong or is this an issue with ember-cli-pagination? Thanks for any help.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12
Top GitHub Comments
Yes, local pagination is working well. This issue is only happening with remote pagination. I’ll be dedicating some time to think about a redesign and I’ll let you know my ideas.
@alejandrodevs how about putting this “quick fix” in the README and close this?