I\'m trying to build a window manager with Angular 2. Basically, I want to be able to swap between windows (that are components injected in a router outlet) without losing t
Checkout canReuse
on the router: canReuse in angular2 api docs
If you specify it the router wont destroy your component when switching away from it.
Here's how I surpassed this requirement.
Once the route changes, the windows components are destroyed. So, to save state in between those windows instances, I had to manually store it into an injected service.
To store and load the state for each window component, I used the life-cycle hooks that are provided by the router: onActivate(next, prev) and onDeactivate(next, prev).
EDIT
Meanwhile, I've opened an issue on Angular 2 github repo requesting this feature.