Conversation
|
You can preview 1eec884 at https://pr24861-1eec884.ngbuilds.io/. |
458cf2f to
525ca3e
Compare
|
You can preview 458cf2f at https://pr24861-458cf2f.ngbuilds.io/. |
There was a problem hiding this comment.
Not a fan of early returns. Makes the code hard to follow. Rewrite as:
if (!preserveContent) {
el.textContent = '';
}
There was a problem hiding this comment.
Why is there an extra method here?
|
You can preview 525ca3e at https://pr24861-525ca3e.ngbuilds.io/. |
7a08d69 to
8617d87
Compare
|
You can preview 7a08d69 at https://pr24861-7a08d69.ngbuilds.io/. |
|
You can preview 8617d87 at https://pr24861-8617d87.ngbuilds.io/. |
|
You can preview 8d290e2 at https://pr24861-8d290e2.ngbuilds.io/. |
|
You can preview 8cafe35 at https://pr24861-8cafe35.ngbuilds.io/. |
8cafe35 to
1f5de46
Compare
|
You can preview 1f5de46 at https://pr24861-1f5de46.ngbuilds.io/. |
|
You can preview f9b7adc at https://pr24861-f9b7adc.ngbuilds.io/. |
There was a problem hiding this comment.
This doesn't seem to be used anywhere. Is it necessary?
There was a problem hiding this comment.
I want to add a number of new integration tests for native stuff, so I added it here, also to make clear that both of these APIs are DEPRECATED
There was a problem hiding this comment.
@robwormald it's better to add these helper methods when we need them, otherwise lots of them go unused. Please use that rule in the future.
There was a problem hiding this comment.
typeof customElements !== 'undefined' could be replaced with this.supportsCustomElements (here and below).
packages/elements/test/slots_spec.ts
Outdated
There was a problem hiding this comment.
Nit: supportsShadowDom implies supportsCustomElements afaict.
packages/elements/test/slots_spec.ts
Outdated
There was a problem hiding this comment.
This component is not used afaict.
packages/elements/test/slots_spec.ts
Outdated
There was a problem hiding this comment.
This should be toBe(), instead of toEqual(), (here and below) to be sure the node is not duplicated or something.
packages/elements/test/slots_spec.ts
Outdated
packages/elements/test/slots_spec.ts
Outdated
1afc17b to
41e0914
Compare
|
You can preview 41e0914 at https://pr24861-41e0914.ngbuilds.io/. |
packages/core/src/render/api.ts
Outdated
There was a problem hiding this comment.
please document the new param
There was a problem hiding this comment.
also please document the default value.
41e0914 to
0f88a25
Compare
|
You can preview a81d30f at https://pr24861-a81d30f.ngbuilds.io/. |
When using ViewEncapsulation.ShadowDom, Angular will not remove the child nodes of the DOM node a root Component is bootstrapped into. This enables developers building Angular Elements to use the `<slot>` element to do native content projection. PR Close #24861
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |


Adds a new optional parameter to the renderer.selectRootElement method:
Before:
preserveContentsdefaults tofalseto preserve existing renderer behavior. If set to true, the renderer will not remove the existing contents of a root element when bootstrapping a component.This is primarily useful when combined with the
ViewEncapsulation.ShadowDomRenderer - the nodes are preserved, and developers can use<slot>elements to re-project the light DOM nodes.This change had to be made to the Renderer API itself, rather than an in a specific renderer as the method is called on the default renderer, inside the view engine, rather than a renderer specific to the component: https://github.com/angular/angular/blob/master/packages/core/src/view/services.ts#L756
Fixes #24859