From 9186068df1ad2e39664442ee549b170988ff836f Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Fri, 24 Feb 2017 15:15:18 -0800 Subject: [PATCH] fix(animations): always create a new `AnimationRenderer` E.g. for no view encapsulation, the delegate will always be the same. Nevertheless, we still need to create a new `AnimationRenderer` per component. Attention: This change will conflict with a local mod in G3. --- .../animations/src/render/animation_renderer.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/@angular/platform-browser/animations/src/render/animation_renderer.ts b/modules/@angular/platform-browser/animations/src/render/animation_renderer.ts index ac2f63bd59..c1c457ab8f 100644 --- a/modules/@angular/platform-browser/animations/src/render/animation_renderer.ts +++ b/modules/@angular/platform-browser/animations/src/render/animation_renderer.ts @@ -20,17 +20,11 @@ export class AnimationRendererFactory implements RendererFactoryV2 { let delegate = this.delegate.createRenderer(hostElement, type); if (!hostElement || !type || !type.data || !type.data['animation']) return delegate; - let animationRenderer = delegate.data['animationRenderer']; - if (!animationRenderer) { - const namespaceId = type.id; - const animationTriggers = type.data['animation'] as AnimationTriggerMetadata[]; - animationTriggers.forEach( - trigger => - this._engine.registerTrigger(trigger, namespaceify(namespaceId, trigger.name))); - animationRenderer = new AnimationRenderer(delegate, this._engine, this._zone, namespaceId); - delegate.data['animationRenderer'] = animationRenderer; - } - return animationRenderer; + const namespaceId = type.id; + const animationTriggers = type.data['animation'] as AnimationTriggerMetadata[]; + animationTriggers.forEach( + trigger => this._engine.registerTrigger(trigger, namespaceify(namespaceId, trigger.name))); + return new AnimationRenderer(delegate, this._engine, this._zone, namespaceId); } }