feat(elements): enable Shadow DOM v1 and slots (#24861)
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 commit is contained in:

committed by
Misko Hevery

parent
4815b92495
commit
c9844a2f01
@ -77,13 +77,12 @@ export class BrowserDetection {
|
||||
|
||||
get supportsShadowDom() {
|
||||
const testEl = document.createElement('div');
|
||||
return (typeof customElements !== 'undefined') && (typeof testEl.attachShadow !== 'undefined');
|
||||
return (typeof testEl.attachShadow !== 'undefined');
|
||||
}
|
||||
|
||||
get supportsDeprecatedShadowDomV0() {
|
||||
const testEl = document.createElement('div') as any;
|
||||
return (typeof customElements !== 'undefined') &&
|
||||
(typeof testEl.createShadowRoot !== 'undefined');
|
||||
return (typeof testEl.createShadowRoot !== 'undefined');
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user