Skip to content

Upgraded element children not destroyed/cleaned #26208

Closed

Description

@jbedard

I'm submitting a...

[X] Bug report  

Current behavior

UpgradeComponent.ngOnDestroy (actually UpgradeHelper.onDestroy) invokes $element.triggerHandler('$destroy') on the upgraded element itself but does not a) cleanup data + event bindings and b) do anything on child elements

Expected behavior

Destroying an upgraded AngularJS component should do the same as destroying in AngularJS. All data + events should be cleaned up and the $destroy DOM event should be triggered, on the element itself and all descendants.

Minimal reproduction of the problem with instructions

https://angular-gitter-nrsm9m.stackblitz.io/ (the red square should be cleaned up along with the upgraded component)

What is the motivation / use case for changing the behavior?

Putting an AngularJS component in Angular should perform proper cleanup, not leak memory.

Environment

Angular version: 6.1.7, but has probably existed forever

Activity

  1. added this to the needsTriage milestone on Oct 2, 2018
  2. added
    memory leak
    on Oct 2, 2018
  3. modified the milestones: needsTriage, Backlog on Oct 2, 2018
  4. added a commit that references this issue on Oct 8, 2018
    623adbb
  5. added 2 commits that reference this issue on Oct 10, 2018
    912f3d1
    6da3867
  6. added 2 commits that reference this issue on Oct 12, 2018
    4f09f7d
    071934e
  7. angular-automatic-lock-bot commented on Sep 14, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  8. locked and limited conversation to collaborators on Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions