The web animation API specifies animationstart and animationend events, but it seems Angular 2 applies animations in a way that makes the events inaccessible.
I have tried grabbing animated elements with ViewChild and applying event listeners (both directly and with Renderer), but the callbacks are never called.
What you can do is specify a timeout when you actually initiate the animation state change that calls a callback after a length of time equal to the length of the transition.
startAnimation() {
this.hero.state = 'active';
setTimeout(() => {
//Do something after the animation.
}, 100);
}
It's a little unwieldy because you have to change the transition and the timeout delay if you want to change the animation timing, but it works well enough. I tried something today where at the end of a translation animation, I immediately switched to a static animation state (with a 0ms transition) and applied a static translation with the Renderer at the same time. It worked smoothly without any jumps or hiccups.