Skip to content
New issue

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

prefetching in $routeProvider #230

Open
sirair opened this issue Nov 16, 2013 · 0 comments
Open

prefetching in $routeProvider #230

sirair opened this issue Nov 16, 2013 · 0 comments

Comments

@sirair
Copy link

sirair commented Nov 16, 2013

I use the following code to make prefetching.

mod.config(function($routeProvider) {
  $routeProvider.when('/', {
    templateUrl: '#page1',
    resolve: {
      prefetchPages: function() {
        $.mobile.loadPage( 'page2.html', { role: 'page' ,prefetch: true } );
        $.mobile.loadPage( 'page3.html', { role: 'page' ,prefetch: true } );
        $.mobile.loadPage( 'page4.html', { role: 'page' ,prefetch: true } );
         .....
        return true;
      }
    }
  });
 $routeProvider.when('/page2', {
    templateUrl: '#page2
});
....

I have the problem that I prefetch all the 10 pages in my app and when I navigate from index page to page2 the index page is removed from the dom. So when I go back to index page, it will be loaded again.
How can I reach that all pages exist in the dom for all time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant