zachsnow / ng-multi-transclude

ng-multi-transclude
MIT License
79 stars 19 forks source link

ng-animate leave bug #17

Open brianephraim opened 9 years ago

brianephraim commented 9 years ago

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?

zachsnow commented 9 years ago

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 commented 9 years ago

@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.

atouchard commented 8 years ago

Finally, is it necessary ? Thanks.