AngularJS css animation + done callback

Viewed 16405

I am using AngularJS and would like to get notified when an animation is done. I know this can be done with javascript-defined animations like this myApp.animation(...), but I am curious if I can do this without javascript.

Question: Is it possible to use angular ng-enter and ng-leave css-transitions, and specify a done callback? I guess the animationend event is fired, so there should be a way to do this.

I have this:

HTML:

<div ng-if="item" class="myDiv"> {{ item.name }} </div>

CSS:

.myDiv.ng-enter {...}
.myDiv.ng-enter.ng-enter-active {...}
.myDiv.ng-leave {...}
.myDiv.ng-leave.ng-leave-active {...}

And I want to call myDone() when the animation has finished (i.e. after the ng-enter-active class is removed).

1 Answers
Related