- 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.
- 計算機網(wǎng)絡(luò)與通信(第2版)
- Application Development with Qt Creator(Second Edition)
- EDA技術(shù)與VHDL編程
- 物聯(lián)網(wǎng)智慧安監(jiān)技術(shù)
- Spring Boot 2.0 Projects
- Web Application Development with R Using Shiny
- 射頻通信系統(tǒng)
- 電力物聯(lián)網(wǎng)工程技術(shù)原理與應(yīng)用
- Unity Artificial Intelligence Programming
- Building Web Applications with ArcGIS
- 4G小基站系統(tǒng)原理、組網(wǎng)及應(yīng)用
- 6G:面向2030年的移動通信
- 沖擊:5G如何改變世界
- 云計算技術(shù)與標(biāo)準(zhǔn)化
- 一本書讀懂TCP/IP