- Mastering Angular Components
- Gion Kunz
- 445字
- 2021-07-23 17:23:40
TypeScript
TypeScript was created in 2012 by Anders Hejlsberg with the intention to implement the future standard of ECMAScript 6 but also to provide a superset of syntax and features that were not part of the specification.
There are many features in TypeScript that are a superset to the ECMAScript 6 standard, including, but not limited to the following:
- Optional static typing with type annotations
- Interfaces
- Enum types
- Generics
It's important to understand that all of the features that TypeScript provides as a superset are optional. You can write pure ECMAScript 6 and not take advantage of the additional features that TypeScript provides. The TypeScript compiler will still transcompile pure ECMAScript 6 code to ECMAScript 5 without any errors.
The problem with any nonstandard language is that nobody can tell how long the language will be maintained and how fast the momentum of the language will be in the future. In terms of support, the chances are high that TypeScript, with its sponsor, Microsoft, will actually have a long life. However, there's still no guarantee that the momentum and trend of the language will keep moving at a reasonable pace. This problem does obviously not exist for standard ECMAScript 6 because it's what the web of the future is made of and what browsers will speak natively.
Still, there are valid reasons to use the extended features of TypeScript if you'd want to address the following concerns that clearly outweigh the negative implications of an uncertain future in your project:
- Large applications that undergo a huge amount of changes and refactoring
- Large teams that require a strict governance while working on code
- Creation of type-based documentation which would otherwise be difficult to maintain
Today's version of Angular is purely based on TypeScript and therefore it's your best option if you're starting to use Angular as your framework. There are also ways to use Angular with pure ECMAScript even without using a transpiler, however, you'll be missing some great language features and support.
- Web安全防護指南:基礎篇
- Application Development with Qt Creator(Second Edition)
- 數(shù)據(jù)通信網(wǎng)絡實踐:基礎知識與交換機技術
- SD-WAN架構與技術(第2版)
- Building RESTful Web Services with Spring 5(Second Edition)
- 大話社交網(wǎng)絡
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡
- 區(qū)塊鏈輕松上手:原理、源碼、搭建與應用
- 網(wǎng)絡安全應急響應技術實戰(zhàn)
- 基于性能的保障理論與方法
- 4G小基站系統(tǒng)原理、組網(wǎng)及應用
- 網(wǎng)絡安全應急響應技術實戰(zhàn)指南
- 物聯(lián)網(wǎng)工程概論
- 深入理解Nginx:模塊開發(fā)與架構解析
- 網(wǎng)絡空間全球治理觀察