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:
Rob Wormald
2018-07-15 18:53:18 -07:00
committed by Misko Hevery
parent 4815b92495
commit c9844a2f01
10 changed files with 32 additions and 58 deletions

View File

@ -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');
}
}