I have an element whose visibility is toggled by ng-show
. I'm also using CSS animations - the automatic ones from ng-animate - on this element to animate its entry.
The element will either contain an image or a video.
In the case that the element contains a video, I want to play it, but I don't want to play the video until it's finished animating in.
As such, I was wondering if there's an easy way to bind a callback to the end of a CSS animation in AngularJS?
The docs reference a doneCallback
, but I can't see a way to specify it...
One workaround(?) I have thought of is $watch
ing element.hasClass("ng-hide-add-active")
and waiting for it to fire with (true, false)
, implying it's just been removed..
Is there a nicer way?