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:
parent
8824e39325
commit
9186068df1
|
@ -20,17 +20,11 @@ export class AnimationRendererFactory implements RendererFactoryV2 {
|
||||||
let delegate = this.delegate.createRenderer(hostElement, type);
|
let delegate = this.delegate.createRenderer(hostElement, type);
|
||||||
if (!hostElement || !type || !type.data || !type.data['animation']) return delegate;
|
if (!hostElement || !type || !type.data || !type.data['animation']) return delegate;
|
||||||
|
|
||||||
let animationRenderer = delegate.data['animationRenderer'];
|
|
||||||
if (!animationRenderer) {
|
|
||||||
const namespaceId = type.id;
|
const namespaceId = type.id;
|
||||||
const animationTriggers = type.data['animation'] as AnimationTriggerMetadata[];
|
const animationTriggers = type.data['animation'] as AnimationTriggerMetadata[];
|
||||||
animationTriggers.forEach(
|
animationTriggers.forEach(
|
||||||
trigger =>
|
trigger => this._engine.registerTrigger(trigger, namespaceify(namespaceId, trigger.name)));
|
||||||
this._engine.registerTrigger(trigger, namespaceify(namespaceId, trigger.name)));
|
return new AnimationRenderer(delegate, this._engine, this._zone, namespaceId);
|
||||||
animationRenderer = new AnimationRenderer(delegate, this._engine, this._zone, namespaceId);
|
|
||||||
delegate.data['animationRenderer'] = animationRenderer;
|
|
||||||
}
|
|
||||||
return animationRenderer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue