fix(platform-browser): allow to mix shadow dom with non shadow dom

Allow to style components that don’t use shadow dom inside of components that do.

This reverts 53cf2ec573
and adds a test for this case.

Related to #7887
This commit is contained in:
Tobias Bosch
2017-02-16 11:56:17 -08:00
committed by Igor Minar
parent 778ded9fcf
commit ab26b6518d
2 changed files with 29 additions and 15 deletions

View File

@ -126,6 +126,7 @@ export class DomRenderer implements Renderer {
let nodesParent: Element|DocumentFragment;
if (this.componentProto.encapsulation === ViewEncapsulation.Native) {
nodesParent = (hostElement as any).createShadowRoot();
this._rootRenderer.sharedStylesHost.addHost(nodesParent);
for (let i = 0; i < this._styles.length; i++) {
const styleEl = document.createElement('style');
styleEl.textContent = this._styles[i];