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.

I’m using infinity with the button mode. But no data is loaded every time the button is clicked.

// the page route
export default Ember.Route.extend(InfinityRoute, {
  ...

  perPageParam: 'limit',
  pageParam: 'page',
  totalPagesParam: 'meta.total_pages',

  model() {
    return RSVP.hash({
      ...

      articles: this.infinityModel('article', {
        perPage: 6,
        startingPage: 1,
        modelPath: 'model.articles'
      })
    })
  },

  ...
});
<!-- the page template -->
<section class="section-articles">
  <div class="row small-up-1 medium-up-2">
    {{#each model.articles as |article|}}
      <div class="columns">
        {{article/article-post article=article}}
      </div>
    {{/each}}
  </div>

  <div class="row">
    <div class="columns small-12">

      <div class="article-load text-center">
        {{lego/button-load-more action="infinityLoad" infinityModel=model.articles buttonClass="button playgroup"}}
      </div>

    </div>
  </div>
</section>

The button component is pretty much the same as the example aside from some cosmetic markup changes.

Here’s how my data looked like. But it’s been normalized and the data node is named article just like the model name.

{
    "data": [ ... ],
    "meta": {
        "total_pages": 39
    }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
rizkysyazulicommented, Jul 30, 2017

okay. problem solved. the problem is in the modelPath, which should be controller.model.modelName.

0reactions
MatthewPardinicommented, May 1, 2019

@snewcomer Yes it is. I pass params and an InfiniteScrollModel extension as arguments as well, but yes, it is the result of that call.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Mobile Data Not Working on Android
A simple and powerful fix for data not working on your Android device is to enter an SCRTN (Special Code to Reset the...
Read more >
How to Fix It When Mobile Data Is Not Working - Lifewire
Mobile data not working on an iPhone or Android can be caused by a damaged SIM card, software or hardware glitches, or a...
Read more >
Cellular Data Not Working on Your iPhone? 7 Ways to Fix It
7 ways to troubleshoot when cellular data is not working on your iPhone · Turn off your Wi-Fi · Toggle Airplane mode ·...
Read more >
Android mobile data not working? Here are some solutions
Android mobile data not working? Here are some solutions · Outages and reception · Reset the APN · Reset settings · Factory data...
Read more >
My Mobile Data Is On But Not Working – Here's The Fix
My Mobile Data Is On But Not Working – Here's The Fix · Toggle on/off Airplane mode · Restart your device · Empower...
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