【问题标题】:Angular2 Final does not work under IE11Angular2 Final 在 IE11 下不起作用
【发布时间】:2017-07-17 08:31:54
【问题描述】:

它工作了一段时间,然后就停止了。可能,我导入了一些组件或做了一些事情。它适用于 Firefox、Chrome、Edge,但不适用于 IE11。

我得到的错误来自 Angular2 核心库。

它说

SCRIPT5007:无法获取未定义或空引用的属性“应用”

并指向这个函数

            function combine(options) {
                return (_a = ((Object))).assign.apply(_a, [{}].concat(options));
                var _a;
            }               

来自角度 intl.ts 文件 https://github.com/angular/angular/blob/master/modules/@angular/common/src/pipes/intl.ts

如何解决这个问题并让它在 IE 上运行?

【问题讨论】:

标签: angular internet-explorer


【解决方案1】:

index.html 中的 Babel 脚本可能会对您有所帮助:

<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.min.js"></script>

【讨论】:

    【解决方案2】:

    使用 angular2 CLI 2.4.* 时,IE 中会出现上述问题。

    要解决此问题,请确保您已使用 Angular CLI 在 polyfills.ts 文件中导入了 polyfill 所需的项目

    /** 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/set';
    

    它对我有用。

    【讨论】:

      猜你喜欢
      • 2018-02-14
      • 1970-01-01
      • 2017-11-26
      • 2016-10-08
      • 2016-03-11
      • 2018-10-25
      • 2019-01-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多