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

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
主站蜘蛛池模板: 成武县| 鄂伦春自治旗| 屏东县| 石门县| 平潭县| 青河县| 太康县| 平顺县| 台南市| 康定县| 鄂尔多斯市| 子洲县| 静乐县| 寿光市| 南阳市| 贵港市| 兴仁县| 昭觉县| 吴旗县| 黎城县| 东台市| 宜丰县| 枣庄市| 浙江省| 阿勒泰市| 达州市| 察隅县| 蒙城县| 丰台区| 岫岩| 平凉市| 临城县| 商河县| 桂林市| 宣威市| 隆尧县| 和政县| 浮梁县| 彝良县| 林西县| 清镇市|