加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

IE11中的Angular 4错误

发布时间:2020-12-17 08:00:53 所属栏目:安全 来源:网络整理
导读:我有一个在Chrome上成功运行的Angular 4项目。 但是它没有在IE11上加载polyfills.bundle.js中的以下错误(我使用命令“ng build –env = prod”来构建站点): var exports = module.exports = function (iterable,entries,fn,that,ITERATOR) { var iterFn = I
我有一个在Chrome上成功运行的Angular 4项目。
但是它没有在IE11上加载polyfills.bundle.js中的以下错误(我使用命令“ng build –env = prod”来构建站点):
var exports = module.exports = function (iterable,entries,fn,that,ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  var f = ctx(fn,entries ? 2 : 1);
  var index = 0;
  var length,step,iterator,result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');

iterFn在这里未定义,因此抛出错误。
请指教。

为了更好地支持IE11,您需要在polyfill中添加一些es6导入。清单如下:
/** 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';

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读