Skip to content

Commit 2e951e0

Browse files
jbdeboerDiana Salsbury
authored and
Diana Salsbury
committed
fix(component factory): Only create a single ShadowDomComponentFactory
1 parent 8aee8f2 commit 2e951e0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/core_dom/module_internal.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CoreDomModule extends Module {
6767
bind(Compiler, toImplementation: TaggingCompiler);
6868
bind(CompilerConfig);
6969

70-
bind(ComponentFactory, toImplementation: ShadowDomComponentFactory);
70+
bind(ComponentFactory, toFactory: (i) => i.getByKey(SHADOW_DOM_COMPONENT_FACTORY_KEY));
7171
bind(ShadowDomComponentFactory);
7272
bind(TranscludingComponentFactory);
7373
bind(Content);

lib/core_dom/static_keys.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Key NG_ELEMENT_KEY = new Key(NgElement);
2323
Key NODE_ATTRS_KEY = new Key(NodeAttrs);
2424
Key NODE_KEY = new Key(dom.Node);
2525
Key NODE_TREE_SANITIZER_KEY = new Key(dom.NodeTreeSanitizer);
26+
Key SHADOW_DOM_COMPONENT_FACTORY_KEY = new Key(ShadowDomComponentFactory);
2627
Key SHADOW_ROOT_KEY = new Key(dom.ShadowRoot);
2728
Key TEMPLATE_CACHE_KEY = new Key(TemplateCache);
2829
Key TEMPLATE_LOADER_KEY = new Key(TemplateLoader);

0 commit comments

Comments
 (0)