-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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
downgraded components within upgraded are not destroyed #22392
Labels
Milestone
Comments
gkalpak
added a commit
to gkalpak/angular
that referenced
this issue
Feb 23, 2018
Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392
3 tasks
gkalpak
added a commit
to gkalpak/angular
that referenced
this issue
Feb 23, 2018
Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392
gkalpak
added a commit
to gkalpak/angular
that referenced
this issue
Feb 23, 2018
Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392
gkalpak
added a commit
to gkalpak/angular
that referenced
this issue
Feb 27, 2018
Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392
alexeagle
pushed a commit
that referenced
this issue
Feb 28, 2018
Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes #22392 PR Close #22400
smdunn
pushed a commit
to smdunn/angular
that referenced
this issue
Feb 28, 2018
…22400) Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392 PR Close angular#22400
This was referenced Mar 15, 2018
This was referenced Mar 15, 2018
leo6104
pushed a commit
to leo6104/angular
that referenced
this issue
Mar 25, 2018
…22400) Previously, when a downgraded component was destroyed in a way that did not trigger the `$destroy` event on the element (e.g. when a parent element was removed from the DOM by Angular, not AngularJS), the `ComponentRef` was not destroyed and unregistered. This commit fixes it by listening for the `$destroy` event on both the element and the scope. Fixes angular#22392 PR Close angular#22400
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a...
Current behavior
ngOnDestroy
is not called in some ng-upgrade cases. Also causes the entire DOM of the route to leak, at least in the example outlined.Expected behavior
All on-destroy methods should be invoked in both Angular and AngularJS when using ng-upgrade.
Minimal reproduction of the problem with instructions
watch the console for all component create/destroy events
https://nested-upgrade.stackblitz.io (using router)
https://nested-upgrade2.stackblitz.io (simpler just using
ngIf
)Essentially...
The
downgraded-component
$destroy seems to never be called. Note that theupgraded-component
ngOnDestroy is called though, so it seems like something is lost between those two?Note that this has nothing to do with the router, that was just my original use case. Anything that adds/removes a component works.
The text was updated successfully, but these errors were encountered: