fix(animations): make sure style calculations are not computed too early (#15540)

Closes #15507
This commit is contained in:
Matias Niemelä
2017-03-28 16:07:49 -07:00
committed by Victor Berchet
parent f368381d12
commit a580f8c61f
5 changed files with 123 additions and 2 deletions

View File

@ -31,6 +31,7 @@ export class MockAnimationDriver implements AnimationDriver {
export class MockAnimationPlayer extends NoopAnimationPlayer {
private __finished = false;
public previousStyles: {[key: string]: string | number} = {};
private _onInitFns: (() => any)[] = [];
constructor(
public element: any, public keyframes: {[key: string]: string | number}[],
@ -45,6 +46,16 @@ export class MockAnimationPlayer extends NoopAnimationPlayer {
});
}
/* @internal */
onInit(fn: () => any) { this._onInitFns.push(fn); }
/* @internal */
init() {
super.init();
this._onInitFns.forEach(fn => fn());
this._onInitFns = [];
}
finish(): void {
super.finish();
this.__finished = true;