fix(animations): ensure web-animations are caught within the Angular zone

Closes #11881
Closes #11712
Closes #12355
Closes #11881
Closes #12546
Closes #12707
Closes #12774
This commit is contained in:
Matias Niemelä
2016-10-31 14:26:41 -07:00
committed by Victor Berchet
parent 6e35d13fbc
commit f80a157b65
5 changed files with 131 additions and 4 deletions

View File

@ -14,4 +14,6 @@ export interface DomAnimatePlayer {
onfinish: Function;
position: number;
currentTime: number;
addEventListener(eventName: string, handler: (event: any) => any): any;
dispatchEvent(eventName: string): any;
}

View File

@ -55,7 +55,7 @@ export class WebAnimationsPlayer implements AnimationPlayer {
// this is required so that the player doesn't start to animate right away
this._resetDomPlayerState();
this._player.onfinish = () => this._onFinish();
this._player.addEventListener('finish', () => this._onFinish());
}
/** @internal */
@ -63,6 +63,8 @@ export class WebAnimationsPlayer implements AnimationPlayer {
return <DomAnimatePlayer>element.animate(keyframes, options);
}
get domPlayer() { return this._player; }
onStart(fn: () => void): void { this._onStartFns.push(fn); }
onDone(fn: () => void): void { this._onDoneFns.push(fn); }