Open minchal opened 4 months ago
elements, platform-browser
When Custom Elements instances are created (using @angular/elements) deep in the stack DOM's attachShadow method of host element is called: https://github.com/angular/angular/blob/main/packages/platform-browser/src/dom/dom_renderer.ts#L424
attachShadow
I would like to inject additional configuration (right now only the default mode: open is used), specifically the serializable: true property, but there might be more use-cases for other config properties: https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#serializable
mode: open
serializable: true
Allow to pass this config through Injector or as createCustomElement configuration.
Make it possible or simplify to extend and override class of ShadowDomRenderer used internally by DomRendererFactory2.
This might also provide a solution for #44110 scoped element registries
Which @angular/* package(s) are relevant/related to the feature request?
elements, platform-browser
Description
When Custom Elements instances are created (using @angular/elements) deep in the stack DOM's
attachShadow
method of host element is called: https://github.com/angular/angular/blob/main/packages/platform-browser/src/dom/dom_renderer.ts#L424I would like to inject additional configuration (right now only the default
mode: open
is used), specifically theserializable: true
property, but there might be more use-cases for other config properties: https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow#serializableProposed solution
Allow to pass this config through Injector or as createCustomElement configuration.
Alternatives considered
Make it possible or simplify to extend and override class of ShadowDomRenderer used internally by DomRendererFactory2.