官术网_书友最值得收藏!

TypeScript comes to the rescue

TypeScript is basically a superset of Javascript, which is a statically typed language. TypeScript does similar to what LESS or SASS does to CSS. TypeScript compiles to Javascript and has almost the same syntax. Anyone from an object-oriented world will find it really, familiar with concepts such as classes, constructors, inheritance, and interfaces.
Many developers will be confused with all these keywords such as ES5, ES6, TypeScript, AtScript, and many others. JavaScript is a community-driven language, and accordingly, browser manufacturers implement those features that are mostly used. Currently, ES5, that is ECMAScript 5, is a standardization by ECMA international. ES6 and ES7 are future standards of JavaScript with tons of new features. We can develop applications in ES6 and ES7 directly with the use of Babel, which is a transpiler. Transpilers are source-to-source compilers that take input in one programming language and output the equivalent code in another language. Although it is recommended to use TypeScript as the majority of work going on in the Ionic community is on TypeScript. Also, you will easily get resources and community help. 
When we start a new Ionic 3 project it create the project with TypeScript, although in Ionic 2 and CLI v2 we had option for creating project with TypeScript. As mentioned, we should use TypeScript because, as the project will become a large scale project, things will be easier to maintain and understand. I want to clear up one important point here about Angular 4: whether it's TypeScript or ES 6 whenever you run the Ionic server, our app folder is transpiled into ES5, as that is what currently all major browsers support. There are many new features available in TypeScript that we will be mainly using in our Ionic or Angular applications. Some of them are listed here:

  • Class and module support
  • Static type-checking
  • Similar syntax to other object-oriented languages
  • ES6 features such as template string support
  • Decorator, annotation support, and dependency injection
  • Arrow functions
主站蜘蛛池模板: 连平县| 灵丘县| 旬邑县| 和硕县| 浦北县| 新巴尔虎左旗| 宁武县| 广安市| 右玉县| 海口市| 许昌市| 涿鹿县| 修水县| 万载县| 昌黎县| 台湾省| 秭归县| 兴业县| 永康市| 富川| 杨浦区| 辽源市| 瑞昌市| 连云港市| 兴文县| 梅河口市| 巍山| 沁水县| 临颍县| 南郑县| 淳化县| 青岛市| 普兰县| 乌什县| 蕉岭县| 荥阳市| 安仁县| 雷州市| 富裕县| 玛沁县| 广东省|