-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Modal doesn't call ngOnDestroy when closing #806
Comments
This sounds potentially more like an Angular bug than an ng-bootstrap one - @pkozlowski-opensource what do you think? NgbModalRef is removing the modal elements by calling viewContainerRef.remove, this seems like a deficiency in ViewContainerRef. |
Agree with @wesleycho that it looks like a bug / sth missing in the Angular itself. I will try to reduce the scenario to sth that is not using ngb and report / fix it upstream. Of course if anyone else has free cycles to provide a simpler reproduce scenario (not involving ng-bootstrap) and report issue upstream - this would be much appreciated! |
Looked into this one a bit and I can't reproduce this with Angular only: https://plnkr.co/edit/AiqvW2yzAgY7LFXjwMWG?p=preview At the same time I can clearly reproduce this with ng-bootstrap + modal: http://plnkr.co/edit/i3ajJvZ3bjQyk2I3rDmy?p=preview Finally it might be an issue on our side and I think that I know what is going on. I need to investigate further to confirm. |
Is this issue fixed. I still face the issue where in I try to close the modal using the .hide() method on the dialogRef but I still see the ngOnDestroy not being called. bootstrap: 3.0.1 |
I see the same issue as well. bootstrap: 4.1.3 |
Any news? bootstrap: 5.2.3 |
When using modal with an external component like this:
ngOnInit
is being called butngOnDestroy
is never called (backdrop close or close function...).The text was updated successfully, but these errors were encountered: