Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unloading lazy loaded modules in Angular 5

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?

like image 241
lynxSven Avatar asked Oct 14 '25 16:10

lynxSven


1 Answers

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

like image 140
lynxSven Avatar answered Oct 17 '25 04:10

lynxSven