I am lazing loading my JS files in my SPA AngularJS app. The problem however is that as I navigate through different pages, the files are not un-loaded.
So say in page1
I load a file called /page1/myService.js
and then in page2
I want to include /page2/myService.js
. These two are two different files, but have the same name, and are both called app.services('myService')
.
This causes a problem because both files with the same name are loaded! Is there a way to overcome this, other than making sure each file has a different name?