【发布时间】:2016-08-26 15:15:20
【问题描述】:
在Angular2 Quickstart Guide 之后,我们被指示在两个地方包含es6-shim:
1) index.html
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
2) typings.json
"ambientDependencies": {
"es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2"
}
我的印象是我们正在将 es6 代码编译为 es5。
在tsconfig.json中配置
{
"compilerOptions": {
"target": "es5",
...
如果最终结果是浏览器正在加载es5,为什么浏览器需要es6 的填充程序?
【问题讨论】: