Javascript 角度5和IE11问题,IE需要垫片
我正在使用Angular 5,并试图在IE11中运行我的应用程序。我已经取消了Javascript 角度5和IE11问题,IE需要垫片,javascript,angular,internet-explorer-11,Javascript,Angular,Internet Explorer 11,我正在使用Angular 5,并试图在IE11中运行我的应用程序。我已经取消了\my app\src\polyfills.ts中必要代码的注释,但不幸的是,我在index.html文件中收到了与此代码相关的以下错误: <script> System.import('main.js').catch(function(err){ console.error(err); }); </script> Error: 'System' is undefined System
\my app\src\polyfills.ts
中必要代码的注释,但不幸的是,我在index.html文件中收到了与此代码相关的以下错误:
<script>
System.import('main.js').catch(function(err){ console.error(err); });
</script>
Error: 'System' is undefined
System.import('main.js').catch(函数(err){console.error(err);});
错误:“系统”未定义
我环顾四周,发现了以下Github问题及其可能的解决方案:
在此线程中,它提到我需要在index.html文件中包含以下内容:
为IE.js安装垫片
现在,我使用的是Angular 5,但我不确定在哪里可以找到这个文件,以便将它放在我的index.html
文件中
如何解决IE11中“系统”未定义的问题 对于
index.html中的非CLI项目导入shim.min.js
<script src="node_modules/core-js/client/shim.min.js"></script>
如前所述,在index.html
文件中添加此元标记
从浏览器列表中的非IE 9-11
行中删除非
关键字file@AbhayGawade抱歉,不确定在何处找到此browserlist文件以删除not
关键字
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10, IE11, and Chrome <55 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/weak-map';
import 'core-js/es6/set';
<meta http-equiv="X-UA-Compatible" content="IE=edge" />