0

Trying to implement lazy load using Requirejs and AngularAMD utility with angularjs.

Everything is fine.

The problem is I have number of controllers, so when I want to load addUserCtrl.js, it get loaded. I am happy that other controller js not loaded yet.

Now the issue rises: when I load allUsersCtrl.js, it get loaded, but addUserCtrl.js is also still loaded. So what I want the previous controllers js should not be in loaded state. Because the application is having number of controllers.

How can I fix it?

VBMali
  • 1,360
  • 3
  • 19
  • 46
  • Your question is unclear. Assume that there are 2 controllers: `controller1` and `controller2`. When `controller1` is loaded, the other controller isn't loaded. Now after that state, you want to load `controller2` ? But during the load, `controller1` should be unloaded ? Is this what you want ? – KarelG Jul 13 '15 at 09:20
  • Yes. When we look at HTML source : we see the script tag get added. As we go loading controllers, script tags get added. – VBMali Jul 13 '15 at 09:23
  • see I have/had made controllers as per functionality. suppose i am doing functionality1 , so i need controller1 now i am doing functioanlity 2, so i need controller2. then what about that controller1? that I dnt need anymore. – VBMali Jul 13 '15 at 09:53
  • 1
    See answer at https://github.com/marcoslin/angularAMD/issues/149 – marcoseu Jul 14 '15 at 20:33

0 Answers0