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

ngOnDestroy #45

Closed
Grayfox12 opened this issue Jul 16, 2018 · 7 comments
Closed

ngOnDestroy #45

Grayfox12 opened this issue Jul 16, 2018 · 7 comments

Comments

@Grayfox12
Copy link
Contributor

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

@kevcjones-archived
Copy link
Collaborator

kevcjones-archived commented Jul 16, 2018 via email

@Grayfox12
Copy link
Contributor Author

Or move this code:
if (this.observer) { this.observer.next(this.result); this.observer.complete(); }
to close method

@Grayfox12
Copy link
Contributor Author

ok i'll try PR)))

@kevcjones-archived
Copy link
Collaborator

kevcjones-archived commented Jul 16, 2018 via email

@Grayfox12
Copy link
Contributor Author

oh yes. And if i override ngondestroy, i have memory leak with unsubscrible observable)))

@kevcjones-archived
Copy link
Collaborator

fixed in 1.3.10

@kevcjones-archived
Copy link
Collaborator

@Grayfox12

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants