Skip to content

Directive memory leak DOM nodes  #19072

Closed
@LiadIdan

Description

@LiadIdan

I'm submitting a...

Bug report

Current behavior

I have a simple directive that creates a new img element and appends it to the host element. The directive applied to the template of a component that nested inside an *ngFor repeater.
When the array of the *ngFor gets updated, or when I navigate back and forth between pages, the nodes count continue to go up and up.

Expected behavior

The detached node should flush from memory.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/6APxdz5myfuVgSrwP056?p=preview
Click on the "Load Posts" button, then on the posts page keep pressing on the "Load More" button / return to the home page and click on the "Load Posts" button again.

Environment

Chrome (desktop) version 60.0.3112.113

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions