Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support configuration of attachShadow when Custom Elements are created #57042

Open
minchal opened this issue Jul 18, 2024 · 0 comments
Open

Support configuration of attachShadow when Custom Elements are created #57042

minchal opened this issue Jul 18, 2024 · 0 comments
Labels
area: elements Issues related to Angular Elements
Milestone

Comments

@minchal
Copy link

minchal commented Jul 18, 2024

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#L424

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

Proposed 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.

@JeanMeche JeanMeche added the area: elements Issues related to Angular Elements label Jul 18, 2024
@ngbot ngbot bot added this to the needsTriage milestone Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: elements Issues related to Angular Elements
Projects
None yet
Development

No branches or pull requests

2 participants