ng-multi-transclude icon indicating copy to clipboard operation
ng-multi-transclude copied to clipboard

ng-animate leave bug

Open brianephraim opened this issue 10 years ago • 3 comments

I want to use this directive in a project but there's a bug with ng-animate during the 'leave' phase. Multi-transcluded elements are removed at the intant the animation begins, rather than at its completion. See this plunkr for a demo of the bug.

http://plnkr.co/edit/YFifzMsjw7jZAiFTEupR?p=preview

If I remove this section from the multi-transclude this bug doesn't appear:

$scope.$on('$destroy', function(){
  if(toTransclude){
    toTransclude.remove();
    toTransclude = null;
  }
});

Does this bit of code solve a memory issue you encountered or is it just there as a precaution?

brianephraim avatar Feb 09 '15 18:02 brianephraim

That was indeed added to address a memory leak, however it was not one that I witnessed. In any event it seems like it would be nice to use $animate everywhere for people that care to add animations.

zachsnow avatar Feb 09 '15 18:02 zachsnow

@defualt I believe that the (possible) need for that code has been obviated by the most recent commit, whereby all DOM nodes remain attached to the document. I'll try to verify. Cheers.

zachsnow avatar Mar 09 '15 03:03 zachsnow

Finally, is it necessary ? Thanks.

atouchard avatar Nov 16 '15 13:11 atouchard