IE11中的Angular 4错误 [英] Angular 4 error in IE11

查看:113
本文介绍了IE11中的Angular 4错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Angular 4项目,可在Chrome上成功运行. 但是,它不会在IE11上加载,但在polyfills.bundle.js中出现以下错误(我使用命令"ng build --env = prod"来构建网站):

I have Angular 4 project that works successfully on Chrome. However it doesn't load on IE11 with the following error in polyfills.bundle.js(I use command "ng build --env=prod" to build site):

var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  var f = ctx(fn, that, entries ? 2 : 1);
  var index = 0;
  var length, step, iterator, result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');

iterFn在这里未定义,因此会引发错误. 请告知.

iterFn is undefined here so error is thrown. Please advise.

推荐答案

为更好地支持IE11,您需要在polyfill中专门添加一些es6导入.列表如下:

For better support of IE11 you need to add some es6 imports exclusively in your polyfills. List is as follows:

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
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/weak-map';
import 'core-js/es6/set';

这篇关于IE11中的Angular 4错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆