0

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?

3
  • What mechanism are you using to lazy load your JS files? Commented May 21, 2014 at 1:52
  • since angularjs doesnt support lazyloading modules it would make sense to tell us what lib you are using exactly. Commented May 21, 2014 at 6:29
  • I am using RequireJS to lazy load m files Commented May 24, 2014 at 20:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.