fix(animations): ensure parent animations are triggered before children (#11201)

This commit is contained in:
Matias Niemelä
2016-09-01 23:24:26 +03:00
committed by Martin Probst
parent e42a057048
commit c9e5b599e4
7 changed files with 135 additions and 21 deletions

View File

@ -0,0 +1,25 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AnimationPlayer} from './animation_player';
var _queuedAnimations: AnimationPlayer[] = [];
/** @internal */
export function queueAnimation(player: AnimationPlayer) {
_queuedAnimations.push(player);
}
/** @internal */
export function triggerQueuedAnimations() {
for (var i = 0; i < _queuedAnimations.length; i++) {
var player = _queuedAnimations[i];
player.play();
}
_queuedAnimations = [];
}