refactor(animations): ensure animation data-structures are created only when used

Closes #12250
This commit is contained in:
Matias Niemelä
2016-10-12 11:24:54 -07:00
committed by Igor Minar
parent 606e51881a
commit 33c8948fd3
7 changed files with 131 additions and 89 deletions

View File

@ -15,8 +15,6 @@ export class ViewAnimationMap {
private _map = new Map<any, {[key: string]: AnimationPlayer}>();
private _allPlayers: AnimationPlayer[] = [];
get length(): number { return this.getAllPlayers().length; }
find(element: any, animationName: string): AnimationPlayer {
var playersByAnimation = this._map.get(element);
if (isPresent(playersByAnimation)) {