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.
This commit is contained in:
Tobias Bosch 2017-02-24 15:15:18 -08:00 committed by Igor Minar
parent 8824e39325
commit 9186068df1
1 changed files with 5 additions and 11 deletions

View File

@ -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;
trigger => this._engine.registerTrigger(trigger, namespaceify(namespaceId, trigger.name)));
return new AnimationRenderer(delegate, this._engine, this._zone, namespaceId);
}
}