-
Notifications
You must be signed in to change notification settings - Fork 27
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 #45
Comments
Ah.. yes. Sorry , in fact I did fall for this. Tbh I had a not ' find a way
not to use ngDestroy' as it's not great practice as it is.
I do accept PRs should you wish to update the docs yourself before I do.
Many thanks for the feedback
…On Mon, 16 Jul 2018, 08:23 Dmitriy, ***@***.***> wrote:
Can you add to docs about ngOnDestroy override? Cause if i implement
ngOnDestroy method in my modal component, observable.next not working. And
listener doesnt know about event from modal window
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#45>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAqe8Mi8i5OmwERJ-PiXAc8wL0h3CIFvks5uHD97gaJpZM4VQql3>
.
|
Or move this code: |
ok i'll try PR))) |
I'll check that, I seem to remember their being a good reason for doing
stuff in destroy. When get back to a screen I'll review. Event listeners on
document rings a bell and making sure I clean up , even when the app
destroys the modal not the user.
…On Mon, 16 Jul 2018, 08:26 Dmitriy, ***@***.***> wrote:
Or move this code:
if (this.observer) { this.observer.next(this.result);
this.observer.complete(); }
to close method
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAqe8M6Ko9EU3qhRBCWR04ZNgSZyFKNsks5uHEApgaJpZM4VQql3>
.
|
oh yes. And if i override ngondestroy, i have memory leak with unsubscrible observable))) |
fixed in 1.3.10 |
In v1.3.13 I've since removed the code inside OnDestroy so that it can be safely extended without needing to know you should call super.ngOnDestroy.. instead @ the point of creation i wrap any ngOnDestroy and do tear down then while still invoking your ngOnDestroy. Thanks for bringing it to my attention and forcing me to think of a way around it 👍 |
Can you add to docs about ngOnDestroy override? Cause if i implement ngOnDestroy method in my modal component, observable.next not working. And listener doesnt know about event from modal window
The text was updated successfully, but these errors were encountered: