角2.0​​:是否支持打字稿的ES6所有功能? [英] Angular 2.0 : Does Typescript support all the features of ES6?

查看:141
本文介绍了角2.0​​:是否支持打字稿的ES6所有功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

打字稿,声称这是JavaScript的一个超集开始。现在有了蠢蠢欲动ES6。请问目前的打字稿transpiler /编译器支持所有ES6功能和语法,因为它是还是从ES6偏离interms语法的模块导入/导出,箭头的功能,等等?

Typescript started by claiming that it is a superset of Javascript. Now with ES6 around the corner. Does the current typescript transpiler/compiler support all the es6 features and syntax as it is or does it deviate from es6 interms of syntax for module export/import, arrow functions, etc?

我问,因为我想学习角2.0,但我不能决定是否遵循打字稿路径或香草JS路径。

I am asking because I am trying to learn angular 2.0 but am not able to decide whether to follow typescript path or vanilla JS path.

推荐答案

至于功能,看到的什么的打字稿的新增内容以及路线图。 (<击>似乎没有被直接比较ES6 / ES2015的功能,虽然打字稿任何页面。见@ alexpod的回答。)

Regarding features, see What's new in TypeScript and the Roadmap. (There doesn't seem to be any page that directly compares ES6/ES2015 features to TypeScript though. See @alexpod's answer.)

我建议你使用打字稿,如果没有别的,对于额外的类型检查。当角转换其code到打字稿,它发现了一些错误。

I suggest you use TypeScript, if for nothing else, for the extra type checking. When Angular converted their code over to TypeScript, it revealed a number of bugs.

打字稿的主要目的,不是功能添加到JavaScript的&ndash的;因为是ES2015的目的 - 但是,使其更容易,更安全开发人员编写和维护大型JavaScript应用程序。打字稿的主要优点显示您的应用程序运行前 - 当你写或维护code。智能感知,code完成,类型检查等。

TypeScript's primary purpose is not to add features to JavaScript – as is the purpose of ES2015 – but to make it easier and safer for developers to write and maintain large JavaScript applications. The primary benefit of TypeScript shows up before your application runs – when you're writing or maintaining code. Intellisense, code completion, type checking, etc.

这篇关于角2.0​​:是否支持打字稿的ES6所有功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆