Angular4 Application running issues in IE11

后端 未结 3 1801
挽巷
挽巷 2020-12-07 21:47

I am building a Angular4 project using Angular CLI (1.1.2). It runs perfectly in Chrome (Version 59.0.3071.115) and firefox(54.0.1) but when I tried to use IE11 (Verison 11.

相关标签:
3条回答
  • 2020-12-07 22:18

    The default polyfills.ts file is commented and need to uncomment lines of code and run npm install the corresponding module. Then it will compatible with the IE11

    0 讨论(0)
  • 2020-12-07 22:26

    To add more detail to @Zeqing's answer.

    I uncommented the following line of codes in .\my-app\src\polyfills.ts :

    /** 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';
    
    0 讨论(0)
  • 2020-12-07 22:39

    I got this when I tried to add an es7 import. I simply replaced the es6 import with the es7 import. Turns out I needed both.

    Gives me "Exception thrown and not caught" error:

    import 'core-js/es7/array';
    

    Works fine:

    import 'core-js/es6/array';
    import 'core-js/es7/array';
    
    0 讨论(0)
提交回复
热议问题