Angular 4.0.0 App built by angular-cli 1.0.0 not working in IE11

前端 未结 2 1988
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-29 23:49

I try to run my virgin Angular 4 Application built by the angular-cli 1.0.0 in the Internet Explorer 11, but I have no success and I get the following error:



        
相关标签:
2条回答
  • 2020-12-30 00:14

    Angular-CLI includes a file in the src/ directory called pollyfills.ts.

     * BROWSER POLYFILLS
     */
    
    /** IE9, IE10 and IE11 requires all of the following polyfills. **/
    import 'core-js/es6/symbol';
    import 'core-js/es6/object';
    import 'core-js/es7/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';
    import 'core-js/es7/array';
    

    Uncomment all of the IE polyfills in that file and things should work swimmingly.

    0 讨论(0)
  • 2020-12-30 00:22

    There is a need for a ES6 polyfill for IE 11. So you have to add a script tag for that required polyfill in order for your app to run on IE11.

    See the docs for guidance on browser support.

    0 讨论(0)
提交回复
热议问题