在IntelliJ IDEA 14中使用TypeScript定位ES5 [英] Targeting ES5 with TypeScript in IntelliJ IDEA 14
本文介绍了在IntelliJ IDEA 14中使用TypeScript定位ES5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Typescript中使用getter和setter。在我尝试这个时,我得到以下内容:
I want to use getters and setters in Typescript. At the moment when I try this I get the following:
error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
如何在IntelliJ 14中配置我的编译器?
这有什么不利之处吗?这会产生一种只能在某些浏览器上运行的不同类型的Javascript吗?
How do I configure my compiler in IntelliJ 14? Are there any disadvantages to this? DOes this produce a different type of Javascript that will only work on certain browsers?
谢谢
推荐答案
要更改编译器选项,您需要转到FileWatcher对话框。
To change the compiler options you need to go to the FileWatcher Dialogue.
设置 - >工具 - >文件监视器
Settings -> Tools -> File Watchers
选择TypeScript并点击编辑(铅笔)按钮。
Select TypeScript and hit the edit (pencil) button.
添加
--target es5
到参数字段
这篇关于在IntelliJ IDEA 14中使用TypeScript定位ES5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文