refactor: misc cleanup (#11654)

This commit is contained in:
Victor Berchet
2016-09-19 17:15:57 -07:00
committed by Alex Eagle
parent 51d73d3e4e
commit 671f73448c
37 changed files with 112 additions and 196 deletions

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ListWrapper, Map, StringMapWrapper} from '../facade/collection';
import {ListWrapper, StringMapWrapper} from '../facade/collection';
import {isPresent} from '../facade/lang';
import {AnimationPlayer} from './animation_player';
@ -47,12 +47,12 @@ export class ViewAnimationMap {
getAllPlayers(): AnimationPlayer[] { return this._allPlayers; }
remove(element: any, animationName: string): void {
var playersByAnimation = this._map.get(element);
if (isPresent(playersByAnimation)) {
var player = playersByAnimation[animationName];
const playersByAnimation = this._map.get(element);
if (playersByAnimation) {
const player = playersByAnimation[animationName];
delete playersByAnimation[animationName];
var index = this._allPlayers.indexOf(player);
ListWrapper.removeAt(this._allPlayers, index);
const index = this._allPlayers.indexOf(player);
this._allPlayers.splice(index, 1);
if (StringMapWrapper.isEmpty(playersByAnimation)) {
this._map.delete(element);