1

I'm using Angular UI router in my app. This is what I'm doing.

  1. A main view contains a child view and a div container for "pagination"
  2. By default, initially, a first set of contents is loaded
  3. When a user clicks on "next page", next set of contents is loaded (with the URL also being changed to /content/2 (where 2 indicates the next page number)

All is working well, but each time the contents are loaded, it goes "blank" before it loads. So it seems like it's reloading the view (which is obvious).

What I would like to do is reload the content without having that "blank" page. How can I achieve this?

ericbae
  • 9,604
  • 25
  • 75
  • 108
  • This may help http://stackoverflow.com/questions/12346690/is-there-a-way-to-make-angularjs-load-partials-in-the-beginning-and-not-at-when – Chandermani Jan 17 '14 at 07:24

1 Answers1

0

At first thought, I think you could you the same approach as infinite-scroll, which is what I'm using. So you make a GET request to the server to get new content and push it to the list on clicking 'next'. However, since the URL changes also. This will cause the controller to be reloaded. You can actually bypass this by setting reloadOnSearch to false.

Tino
  • 436
  • 4
  • 6