99x / boilerplatejs

Your own boilerplate code to start your next big javascript project. We incorporate the best design practices with best in market open source libraries.
MIT License
278 stars 79 forks source link

How can I stop previously started module? #20

Closed dredzone closed 11 years ago

dredzone commented 11 years ago

Seems like its not possible to stop module, and context instance has no knowledge of what modules are running.

hasith commented 11 years ago

Yes, context loads all the modules and there is no lifecycle management done by contexts. But the controllers (DOMController and URLController) take care of lifecycle management of UI components (or technically any object with activate(), deactivate() methods).

This is by design since it is the Controllers who know the scope (parent DOM element) on to which the UIComponents are to be attached. When a new UIComponent is activated, deactivation happens within that scope only.