fix(platform-browser): should only add styles with native encapsulation in shadow DOM (#14313)

Closes #7887

PR Close #14313
This commit is contained in:
Dzmitry Shylovich
2017-02-06 00:49:01 +03:00
committed by Miško Hevery
parent 1cfbefebe3
commit 53cf2ec573
2 changed files with 85 additions and 1 deletions

View File

@ -127,7 +127,6 @@ 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];