Button icons are removed from the DOM during :leave animation transition
Button icons are not removed from the DOM during :leave animation transition
http://plnkr.co/edit/0isC66y8r1Opxfkib60F?p=preview
Thanks for reporting this, very peculiar. The button ngOnDestroy hook is called immediately when the animation starts, and it cleans up the markup for the button. This behavior looks like a bug in angular (see this plunker). I have logged this in the Angular repo. I am afraid that we do not have a hook that we can use to resolve this in the directive.
Fixed in v3.0.5-dev
Here's an updated plunkr.
@tsvetomir Out of curiosity, how did you fixed this? There are other repos running into this issue.
@Ploppy3 the fix was to leave the image elements in the DOM. Only the references to the elements are cleared in ngOnDestroy so they don't leak memory.
The elements are removed by Angular when the parent component is updated.
Most helpful comment
Fixed in v3.0.5-dev