Play! Framework - How to load public files (js, css, img) only once?

2

Hello,

I started using Play! Framework with little time AngularJS, and I'm having problems to use AngularJS services, therefore I'm a variable on a page and when I go to check this variable on another page the value is null. I noticed that the application loads the files statically every time I access a page.

How do I load these files once in the application, and then not have to download them again (every page accessed) and lose the values of my js variables?

    
asked by anonymous 16.06.2016 / 21:30

1 answer

2

Angular is a framework for SPAs (Single Page Applications). It is easy to preserve data between scope changes - however if you are reloading your application you need to store them between loads.

Preserve your data in localStorage , and retrieve it every time your application is initialized.

Here are some libraries that you can use for this purpose:

16.06.2016 / 22:02