gpt4 book ai didi

Angular 2 - script5007 : Unable to get property 'apply' of undefined or null reference

转载 作者:太空狗 更新时间:2023-10-29 17:21:47 24 4
gpt4 key购买 nike

我创建了一个简单的项目:

ng new my-app
cd my-app
ng serve

Chrome 和 Firefox 没问题,但是当我在 IE 11 中执行时,它返回这个错误:SCRIPT5007

enter image description here enter image description here

有人可以帮助我吗?

最佳答案

这是 CLI 的问题,而不是 Angular 问题

在较新版本的 ANGULAR - CLI 中,src\polyfills.ts 默认被注释掉。

  1. 打开文件src/polyfills.ts
  2. 取消注释这些文件并完成

浏览器填充

/** IE9、IE10 和 IE11 需要以下所有 polyfill。 **/

这是文件列表:

 import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/set';

关于 Angular 2 - script5007 : Unable to get property 'apply' of undefined or null reference,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42273375/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com