我有一个Angular 2应用程序,最初在Internet Explorer版本10和11中遇到了问题,在我的帖子:Angular 2 Release (2.0.1) Internet Explorer (SystemJS) Syntax Error中描述了这一点。
由于某种原因,这个错误消失了(可能是从那个问题上发布的答案中),但现在我得到了以下错误:
TypeError: Object doesn't support this action
at MyAppService.prototype.myFunction(eval code:64:9)
at Anonymous function (eval code:359:21)
at SafeSubscriber.prototype.__tryOrUnsub (eval code:223:13)
at SafeSubscriber.prototype.next (eval code:172:17)
at Subscriber.prototype._next (eval code:125:9)
at Subscriber.prototype.next (eval code:89:13)
at MapSubscriber.prototype._next (eval code:83:9)
at Subscriber.prototype.next (eval code:89:13)
at onLoad (eval code:1230:25)
at ZoneDelegate.prototype.invokeTask (http://localhost:56159/node_modules/zone.js/dist/zone.js:234:17)其中MyAppService是我创建的服务,myFunction是在该服务中定义的函数,我从我的组件调用它。
虽然我希望这个问题可能与垫片有关-但我已经加载了es-5和es-6:
<script src="./node_modules/es5-shim/es5-shim.js"></script>
<script src="./node_modules/es6-shim/es6-shim.js"></script>今天早些时候通过npm下载的,最重要的是我所有其他的angular脚本。
这个应用程序在Chrome和Firefox中都能正常工作
有什么想法吗?
发布于 2020-04-24 00:47:23
如果任何人面临类似的问题,你需要包括url-polyfill,因为IE不支持URL。npm I url-polyfill并将其导入polfills.ts文件中。这就是我的问题所在。
https://stackoverflow.com/questions/41967129
复制相似问题