-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
NgOnDestroy no longer being called when navigating to another route #61
Comments
Are you using clearHistory? ngOnDestroy is not called on forward navigation because the component is reused on back navigation. |
Everywhere except a couple spots is set to true. |
@edusperoni https://github.com/herefishyfish/ngDestroy-bug here's an example of what @JakeAi is experiencing. Note that ngOnDestroy will get called on the back event to close the app in this scenario. |
I can confirm that is what I am seeing and experiencing. Thanks for the reproduction. |
@edusperoni can confirm. NativeScript/nativescript-angular#2026 is probably related. Would it be possible to publish your fix as a separate version so we can use while waiting for the merge, because my workaround is not perfect. Thanks. |
Latest alpha contains this fix and a few more, please try that! |
What is the state of this issue? I've noticed this stopped working after upgrading to Angular 13. Is there a workaround? |
@jnorkus try installing the latest alpha, as this issue should be fixed there. I think we should move it to stable this week |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
To Reproduce
Expected behavior
If ngOnInit is being called, why wouldn't ngOnDestroy be called? I am using nsRouterLink to navigate to complete different routes.
The text was updated successfully, but these errors were encountered: