简体   繁体   English

Angular2 Final在IE11下不起作用

[英]Angular2 Final does not work under IE11

It worked for some time and after that stopped. 它工作了一段时间,然后停了下来。 Probably, I imported some component or did something. 可能是我导入了某些组件或执行了某些操作。 It works on Firefox, Chrome, Edge, but not on IE11. 它适用于Firefox,Chrome,Edge,但不适用于IE11。

The error I get is from the Angular2 core library. 我收到的错误来自Angular2核心库。

It says 它说

SCRIPT5007: Unable to get property 'apply' of undefined or null reference SCRIPT5007:无法获取未定义或空引用的属性“应用”

and points to this function 并指向此功能

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

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

How I can fix this and make it work on IE? 如何解决此问题并使其在IE上正常工作?

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

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

While using angular2 CLI 2.4.* the above issue will occur in IE. 在使用angular2 CLI 2.4。*时,以上问题将在IE中发生。

To resolve this issue make sure that you have imported the items which is need for polyfills in polyfills.ts file using angular CLI 要解决此问题,请确保已使用角度CLI在polyfills.ts文件中导入了polyfills所需的项目。

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

Its working for me. 它为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM