Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Controllers loadin every single time I hit the page

$
0
0

there are two caches --> forwardCache and default caching (only backviews --> caches the previously visited pages).

And the caches are holding only a specific number of views (default 10)

Look into:
http://ionicframework.com/docs/api/provider/$ionicConfigProvider/

Yeah and for your problem --> use services to load and store your data and do not do such things in the controller :wink:.

Like service:

  • provide get method
  • sends request to your api and loads the items if the items are not already loaded --> stores them in the service
  • if items already loaded --> return them without sending the request again

So you can reuse your items through your whole app after you have loaded them once.


Viewing all articles
Browse latest Browse all 228595

Trending Articles