Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

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?

share|improve this question
    
What mechanism are you using to lazy load your JS files? – miqid May 21 '14 at 1:52
    
since angularjs doesnt support lazyloading modules it would make sense to tell us what lib you are using exactly. – mpm May 21 '14 at 6:29
    
I am using RequireJS to lazy load m files – Kousha May 24 '14 at 20:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.