Angular2 Exception: TypeError el.createShadowRoot is not a function (Safari / Edge)

I have an angular2 application that works fine in Chrome and Firefox, but in Safari I get this error:

TypeError el.createShadowRoot is not a function

And similarly in Edge:

The object does not support the property or method 'createShadowRoot' at BrowserDomAdapter.prototype.createShadowRoot ( http: // localhost: 5000 / lib / angular2 / bundles / angular2.dev.js: 22893: 7 )

More from the edge: enter image description here

Am I missing any gasket or polymer?

+5
source share
2 answers

createShadowRoot()should be called only when used ViewEncapsulation.Native.

ViewEncapsulation.Emulated , ( , TS toolchain, Dart)

+7

, Firefox el.createShadowRoot is not a function

, createShawdowRoot attachShadow() https://developer.mozilla.org/en-US/docs/Web/API/Element/createShadowRoot

Angular, ViewEncapsulation.Native, , ViewEncapsulation.ShadowDom, , https://angular.io/api/core/Component#encapsulation

.

, createShawdowRoot, Firefox.

0

Source: https://habr.com/ru/post/1624557/


All Articles