question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Data not showing in view after moving to Ember 3.0

See original GitHub issue

My 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:open
  • Created 6 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
alejandrodevscommented, May 11, 2018

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.

1reaction
roschaefercommented, Jun 17, 2018

@alejandrodevs how about putting this “quick fix” in the README and close this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

view not refreshing after receiving updated data from backend ...
Index view not refreshing after receiving updated data from backend · Open any other route · Go back to the locators index route...
Read more >
Issues · mharris717/ember-cli-pagination - GitHub
Contribute to mharris717/ember-cli-pagination development by creating an account on GitHub. ... Data not showing in view after moving to Ember 3.0.
Read more >
The Road to Ember 3.0
Ember 3.0 removes public API deprecated in Ember 2.x releases. 3.0 does not introduce new public APIs or breaking changes.
Read more >
Should Components Load Data? - Ember Igniter
The answer to our question seems to be a resounding no. This design pattern almost forbids accessing data directly from a component (by...
Read more >
Testing your Ember application in 2018 - DockYard
A journey through testing your Ember Application in 2018.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found