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

Asked

Viewed 63 times

2

Hello,

I started using Play! Framework a short time with Angularjs, and I’m having problems to use Angularjs services, because if a variable in a page and when I consult this variable in 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 only once in the application, then not have to download them again (every page accessed) and lose the values of my variables js?

1 answer

2


Angular is a framework for Spas (Single Page Applications). It’s easy to preserve data between scope changes - however if you’re reloading your application you need to store it between loads.

Preserve your data in localStorage, and retrieve them each time your application is initialized.

Follow some Libraries which you can use for this purpose:

  • 1

    Thank you for the answer! I found in these Libraries the solution to my problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.