I use hammer.js in my applications (Angular 2 and 5). I use events from this library, as example - tap. If I destroy any DOM-element with the help of *ngIf, there's subscription on the event. As a result, there's a reference to the DOM-object in the memory.
<div class="nnn"
(tap)="ontp()"
></div>
<ng-container *ngIf="_show">
<div class="arr"
*ngFor="let item of _items"
(tap)="onT()"
>
{{item}}
</div>
</ng-container>
How I can remove listener from this DOM-element?
It is a bug in Angular: https://github.com/angular/angular/issues/22155 Pull request and workaround: https://github.com/angular/angular/pull/22156