Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

angular

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

TypeError el.createShadowRoot is not a function

And similarly in Edge:

Object doesn't support property or method 'createShadowRoot' at BrowserDomAdapter.prototype.createShadowRoot (http://localhost:5000/lib/angular2/bundles/angular2.dev.js:22893:7)

More from Edge: enter image description here

Is there some shim or polymer I am missing?

like image 932
brando Avatar asked Jan 16 '16 07:01

brando


1 Answers

createShadowRoot() should only be called if you use ViewEncapsulation.Native.

Either use ViewEncapsulation.Emulated or ensure polyfills are loaded (I can't guide you how, because I don't use the TS toolchain, only Dart)

like image 85
Günter Zöchbauer Avatar answered Sep 28 '22 00:09

Günter Zöchbauer