Nik*_*Nik 3 angular-cli angular
我无法让IE10加载一个全新的Angular CLI项目.运行"ng new"时,除了默认的Angular CLI包之外,没有其他代码.
我使用的是Angular 4.2.4,@ angular/cli 1.3.1和IE 10.0.9200.16519
我试过'ng build'和'ng build --prod'并且都返回相同的错误消息.该项目在其他所有浏览器上运行.
我已经取消注释了在项目的polyfills.ts中运行IE9,IE10,IE11所需的所有polyfill行(并按照文件中的说明安装了所有内容).
这4个错误是:
预期标识符polyfills.bundle.js,第6127行,第67个字符
var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
Run Code Online (Sandbox Code Playgroud)
对象不支持属性或方法'bind'styles.bundle.js,第279行字符3
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
Run Code Online (Sandbox Code Playgroud)
预期标识符vendor.bundle.js,第2056行第71个字符
exports.rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
Symbol.for('rxSubscriber') : '@@rxSubscriber';
Run Code Online (Sandbox Code Playgroud)
Object不支持属性或方法'defineProperty'main.bundle.js,第132行字符1
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
Run Code Online (Sandbox Code Playgroud)
似乎' 符号 ',' 绑定 '和' defineProperty '是罪魁祸首.
我确实看到符号和对象es6 polyfill包含在pollyfills.ts项目文件中:
****************************************
* 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)
Run Code Online (Sandbox Code Playgroud)
我如何在IE10上实现这一目标?
加:
<meta http-equiv="x-ua-compatible" content="IE=edge">
Run Code Online (Sandbox Code Playgroud)
到<head>index.html的部分.
将IE9,IE10,IE11兼容模式设置为EDGE修复了所有问题.
| 归档时间: |
|
| 查看次数: |
2465 次 |
| 最近记录: |