最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Does Angular require TypeScript? - Stack Overflow

programmeradmin4浏览0评论

I have just had a look at the Angular quickstart document and it shows the usage of TypeScript. A thought has just popped into my mind:

Does Angular require TypeScript?

Then a few seconds later:

How does Angular relate to TypeScript?

A quick Google of the first question does not lead to a direct answer. As I can’t be the first or the last person to ask this question, I am posting it to Stackoverflow.

I have just had a look at the Angular quickstart document and it shows the usage of TypeScript. A thought has just popped into my mind:

Does Angular require TypeScript?

Then a few seconds later:

How does Angular relate to TypeScript?

A quick Google of the first question does not lead to a direct answer. As I can’t be the first or the last person to ask this question, I am posting it to Stackoverflow.

Share Improve this question edited Aug 4, 2015 at 13:26 Tom Fenech 74.7k13 gold badges117 silver badges151 bronze badges asked Aug 4, 2015 at 11:14 Ian RingroseIan Ringrose 51.9k57 gold badges218 silver badges322 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 17

Does Angular require Typescript

No it doesn't. You can use normal Javascript also. The designers wanted to give as many choices as possible so the framework is easily accessible by many people. The Typescript piler generates ES6/ES5 pliant code you can consume.

The Angular2 "Getting Started" shows all examples in both TypeScript and ES5.

How does Angular relate to Typescript

All the source code will be written in Typescript.

However, they also need to support transpiling to Dart (using ts2dart), so some parts of the code base are written just so transpiling to Dart is possible. For example, Dart has a notion of constant expressions, so they have to use CONST_EXPR in the TS code (which makes the code base more plicated). This is only an implementation detail and user code does not have to worry about this.

发布评论

评论列表(0)

  1. 暂无评论