Angular2异常:TypeError el.createShadowRoot不是一个函数(Safari/Edge) [英] Angular2 Exception: TypeError el.createShadowRoot is not a function (Safari/Edge)
问题描述
我有一个angular2应用程序,可在Chrome和Firefox上很好用,但是在Safari中出现此错误:
I have an angular2 app that works great in Chrome and Firefox, but in Safari I get this error:
TypeError el.createShadowRoot不是函数
TypeError el.createShadowRoot is not a function
同样在Edge中:
对象不支持属性或方法"createShadowRoot" 在BrowserDomAdapter.prototype.createShadowRoot( http://localhost:5000/lib/angular2/bundles/angular2.dev.js:22893:7 )
Object doesn't support property or method 'createShadowRoot' at BrowserDomAdapter.prototype.createShadowRoot (http://localhost:5000/lib/angular2/bundles/angular2.dev.js:22893:7)
来自Edge的更多内容:
More from Edge:
我缺少一些垫片或聚合物吗?
Is there some shim or polymer I am missing?
推荐答案
createShadowRoot()
仅在使用ViewEncapsulation.Native
时才能调用.
createShadowRoot()
should only be called if you use ViewEncapsulation.Native
.
要么使用ViewEncapsulation.Emulated
要么确保加载了polyfill(我不能指导您如何操作,因为我不使用TS工具链,仅使用Dart)
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)
这篇关于Angular2异常:TypeError el.createShadowRoot不是一个函数(Safari/Edge)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!