- Hybrid Mobile Development with Ionic
- Gaurav Saini
- 331字
- 2021-07-02 23:53:50
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
- Web Application Development with R Using Shiny(Second Edition)
- 深入理解Java7:核心技術與最佳實踐
- Python Data Analysis(Second Edition)
- AutoCAD VBA參數化繪圖程序開發與實戰編碼
- Mathematica Data Analysis
- Learning Python Design Patterns
- 代替VBA!用Python輕松實現Excel編程
- Getting Started with Python
- 邊玩邊學Scratch3.0少兒趣味編程
- PHP 8從入門到精通(視頻教學版)
- Practical Predictive Analytics
- Solr權威指南(下卷)
- 用Python動手學統計學
- Java程序性能優化實戰
- 狼書(卷2):Node.js Web應用開發