2

I want to unload all used modules when a user logs out of the webside to reset the application. When a new logs into the backendserver with the same running application all lazy loaded modules are still there. I did some research and seems to me like it isn't possible by now.

Does somebody know a solution or a githublink to the ticket?

lynxSven
  • 493
  • 1
  • 8
  • 19

2 Answers2

3

I guess unloading my modules was the wrong direction.

Once the chunks are loaded they shouldn't be constructed again.

I register the services in another service. Now when I Logout I call a function which iterates through all the services and calls a function for every service which empties all data by the previous User.

----------EDIT---------

Seeing that this question still get views here is a solution I used for some Apps:

Kudos to user benh80

Resetting the complete App and reloading it: Resetting Angular 2 App

lynxSven
  • 493
  • 1
  • 8
  • 19
0

the whole point of using lazy loading is to load the relevant modules for a component. Once you log out the application it actually loads the modules which need for that component. Hence there is nothing to unload

Sachila Ranawaka
  • 31,266
  • 5
  • 51
  • 75