Closed mieszko4 closed 11 years ago
Hi, I uploaded your example to plncr.co, so I can modify it: http://plnkr.co/edit/2eZ9k1B2yyM9CK83X3D5?p=preview
In contrast to angular, the adapter caches pages/views. The caching is a feature of jquery mobile and can be controlled using the data-dom-cache
attribute, see here: http://jquerymobile.com/demos/1.2.0/docs/pages/page-cache.html. All views defined in the index.html are cached by default. External views are only cached until navigating to another view, unless it's the same view.
This caching is good thing for performance, as angular does not need to recompile the views, so you could turn it on by adding data-dom-cache=true
to every partial: http://plnkr.co/edit/i5td2AuZsGPOfowTcQDa?p=preview. Now every controller is created only once, when the view is visited for the first time.
If you want to update the view using the data from the route, use the new onActivate
property of routes (https://github.com/tigbro/jquery-mobile-angular-adapter#navigation-and-routes). Here is a modified version of your code showing how to access route params: http://plnkr.co/edit/MWQRkxNvYFezPJAybaMz?p=preview
Hope this helps, Tobias
Many many thanks! This has definitively helped me!
The problem: I have defined 3 routes with two partial templates assigned to the same Controller TestCtrl. When uri is changed through $location.path(), controller does not reload if new uri has the same templateUrl defined.
Code: Please take a look at the code: http://plnkr.co/edit/6HfpflBYVn0Pf2oIa5ov Since it requires rooting I uploaded the same code to:
How to reproduce:
The problem is that controller does not reload in the same way as with clean version.