Angular App Empty Page in IE but works in Chrome

后端 未结 4 2231
情歌与酒
情歌与酒 2021-02-19 10:26

I have started learning Angular 4 and wrote a default application using Angular CLI (NG New HelloWorld). When i write ng serve, and browse

4条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 10:36

    Found my answer here: Angular4 Application running issues in IE11.

    Go to polyfills.ts file under the src/ folder and then as per the instructions in that file, uncomment (or add if there aren't these lines) the following lines:

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

    Final notes

    For the newer versions of core-js you need to change the import from '…/es6/…' to '…/es/…' (example: import 'core-js/es/symbol';).

提交回复
热议问题