Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routerCanReuse prevent a component from being destroyed when navigated away #8115

Closed
Binvention opened this issue Apr 18, 2016 · 3 comments
Closed

Comments

@Binvention
Copy link

Currently, routerCanReuse lifecycle hook only takes effect when navigating from one location to a location that contains the same component which I see how that is useful for if you're having a form field or something similar stay constant from location to location but it doesnt keep the component alive if it isn't in the next navigation. I think it would make a lot more sense if it also allowed the components to stay alive (but hidden) when navigating to a location that doesn't contain that component. Just for example I have a component that contains many WebGL images and whenever I renavigate to that page it has to recreate all of those WebGL images which can take a lot of processing and is rather slow on the other hand if they could stay running in the background when on pages that don't contain them it wouldn't require so much loading. this would also be useful for components that require a lot of network activity so that they could stay running (keeping all of their network retrieved data) even when they aren't part of the current navigation. One other major situation that I would like to see this implemented for is when you want to edit a different navigation route's component from the current component like an options page or something similar.

@vicb
Copy link
Contributor

vicb commented Sep 27, 2016

obsolete

@vicb vicb closed this as completed Sep 27, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants