Angular CLI + Angular 4 = IE10不起作用 [英] Angular CLI + Angular 4 = IE10 doesn't work
问题描述
我无法让IE10加载全新的Angular CLI项目.当您运行"ng new"时,除了默认的Angular CLI软件包附带的代码外,没有其他代码.
I can't get IE10 to load a brand new Angular CLI project. There is no other code other than what comes with default Angular CLI package when you run 'ng new'.
我正在使用Angular 4.2.4,@ angular/cli 1.3.1和IE 10.0.9200.16519
I'm using Angular 4.2.4, @angular/cli 1.3.1 and IE 10.0.9200.16519
我已经尝试过'ng build'和'ng build --prod',并且都返回相同的错误消息.该项目可在其他浏览器上运行.
I have tried 'ng build' and 'ng build --prod' and both return the same error messages. The project runs on every other browser.
我已取消注释在项目的polyfills.ts中运行IE9,IE10,IE11所需的所有polyfill行(并按照文件中的说明安装了所有内容).
I have uncommented all polyfill lines (and installed everything as per instructions in the file) that are needed to run IE9, IE10, IE11 in the polyfills.ts of the project.
4个错误是:
期望的标识符polyfills.bundle.js,第6127行,字符67
var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
对象不支持属性或方法绑定" styles.bundle.js,第279行第3个字符
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
期望的标识符vendor.bundle.js,第2056行,字符71
exports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
Symbol.for('rxSubscriber') : '@@rxSubscriber';
对象不支持属性或方法'defineProperty'main.bundle.js,第132行字符1
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
罪魁祸首似乎是"符号","绑定"和" defineProperty ".
Seems like 'Symbol', 'bind', and 'defineProperty' are the culprits.
虽然我确实在pollyfills.ts项目文件中包含了Symbol和Object es6多边形填充物:
I do see Symbol and Object es6 polyfills being included in the pollyfills.ts project file though:
****************************************
* BROWSER POLYFILLS
*/
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
import 'core-js/es6/symbol';
import 'core-js/es6/object';
...
(+ all the other polyfills that are in the polyfills.ts file)
如何在IE10上进行此操作?
How do I get this going on IE10?
推荐答案
添加:
<meta http-equiv="x-ua-compatible" content="IE=edge">
至index.html的<head>
部分.
to <head>
section of index.html.
将IE9,IE10,IE11兼容模式设置为EDGE可以解决所有问题.
Setting IE9,IE10,IE11 compatibility mode to EDGE fixed all the issues.
这篇关于Angular CLI + Angular 4 = IE10不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!