首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular 2 Final Release IE11 TypeError:对象不支持此操作

Angular 2 Final Release IE11 TypeError:对象不支持此操作
EN

Stack Overflow用户
提问于 2017-02-01 04:43:35
回答 1查看 1.4K关注 0票数 3

我有一个Angular 2应用程序,最初在Internet Explorer版本10和11中遇到了问题,在我的帖子:Angular 2 Release (2.0.1) Internet Explorer (SystemJS) Syntax Error中描述了这一点。

由于某种原因,这个错误消失了(可能是从那个问题上发布的答案中),但现在我得到了以下错误:

代码语言:javascript
复制
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:

代码语言:javascript
复制
<script src="./node_modules/es5-shim/es5-shim.js"></script>
<script src="./node_modules/es6-shim/es6-shim.js"></script>

今天早些时候通过npm下载的,最重要的是我所有其他的angular脚本。

这个应用程序在Chrome和Firefox中都能正常工作

有什么想法吗?

EN

回答 1

Stack Overflow用户

发布于 2020-04-24 00:47:23

如果任何人面临类似的问题,你需要包括url-polyfill,因为IE不支持URL。npm I url-polyfill并将其导入polfills.ts文件中。这就是我的问题所在。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41967129

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档