-
Notifications
You must be signed in to change notification settings - Fork 114
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
Integrate page prefetching in $routeProvider #206
Comments
+1 |
Hi,
Start chrome and open the dev tools, the load this plunk: http://plnkr.co/edit/zxhGwCx1OSdi9ObTmfKC?p=preview Hope this helps, |
Hi, I have some directives that manipulate DOM and they needs to read width/height of DOM elements during initialization. Preloaded pages always return 0 for width / height, which makes the directives not functioning at all. Do you have any idea how I can prefetch pages and at the same time re-initialize directives before showing the page ? I have tried listening to JQM event and reinitializing directives on pageshow event, but I believe there are better ways to do it. |
The problem is the browser has never rendered the DOM element. You need to attach the elements to the DOM then they get a height. Maybe you can make a plnkr for this? |
I use the solution of TBosch for my prefetching. But I have the problem that I prefetch all the 10 pages in my app and when I navigate from page1 to page2 the page1 is removed from the dom. So when I go back to page1, it will be loaded again. |
Problem:
$.mobile.page.prototype.options.domCache = true;
results on heavy usage in the same result as 1.Solution:
Use jqm page preloading.
Problem 2:
Does not work so well when using ng-click and changing the page via
$location.path()
.Solution 2:
Integrate the caching in the $routeProvider.
Example:
This should load the pages in the background after the route was changed successfully. This should also store the previous visited page so going back in the app is also as smooth as going forward.
What do you think?
The text was updated successfully, but these errors were encountered: