3. What is TypeScript?
❖ TypeScript is designed for large-scale application
❖ Can be compiled to plain Javascript for any browser,any OS
and it’s Open Source
❖ Developed and maintained by Microsoft
❖ First appeared: October 1st, 2012, first release July 2014
Current version: 1.8 on January 2016
8. Why using it?
❖ Javascript is not designed for Large-Scale applications
9. Why using it?
❖ Javascript is not designed for Large-Scale applications
❖ OOP programming
10.
11. Why using it?
❖ Javascript is not designed for Large-Scale applications
❖ OOP programming
❖ TypeScript = ES6 + Optional Typing
12.
13. Why using it?
❖ Javascript is not designed for Large-Scale applications
❖ OOP programming
❖ TypeScript = ES6 + Optional Typing
➢ …
➢ For … of
➢ Spread operator
➢ Promise
14. Why using it?
❖ Javascript is not designed for Large-Scale applications
❖ OOP programming
❖ TypeScript = ES6 + Optional Typing
❖ TypeScript is using in common JS Frameworks:
➢ Angular2
➢ Ionic
➢ Meteor
15. Why using it?
❖ Javascript is not designed for Large-Scale applications
❖ OOP programming
❖ TypeScript = ES6 + Optional Typing
❖ TypeScript is using in common JS Frameworks:
➢ Angular2
➢ Ionic
➢ Meteor
16.
17.
18. Why using it?
❖ Prevent Javascript common mistake (Non-blocking issue)
19.
20.
21. Why using it?
❖ Prevent Javascript common mistake (Non-blocking issue)
❖ Output for ES5, ES6, ES7 and future Javascript
22. Why using it?
❖ Prevent Javascript common mistake (Non-blocking issue)
❖ Output for ES5, ES6, ES7 and future Javascript
❖ Output to CommonJS/System/AMD/UMD format
27. Why using it?
❖ Prevent Javascript common mistake (Non-blocking issue)
❖ Output for ES5, ES6, ES7 and future Javascript
❖ Output to CommonJS/AMD format
❖ Unlike CoffeeScript, Dart. Learning TS it is not about
learning new language.
31. Why using it?
❖ Prevent Javascript common mistake (Non-blocking issue)
❖ Output for ES5, ES6, ES7 and future Javascript
❖ Output to CommonJS/AMD format
❖ Unlike CoffeeScript, Dart. Learning TS it is not about
learning new language.
❖ Easy to discontinue
32. Cons
❖ Write more type definitions
❖ Need to setup Typescript compiler
❖ Remove some free style
33. Demo
❖ Installation
$ sudo npm install -g typescript
❖ Tools
➢ Visual Studio, Visual Studio Code, Web Maxtrix
➢ Eclipse, Netbean
➢ Vim
➢ Atom
➢ Sublime
➢ Grunt, Gulp
34. Demo - Supported types
❖ boolean
❖ number
❖ string
❖ enum
❖ any
❖ void
❖ array
35. Demo - ES6 features
❖ let
❖ arrow function
❖ const
❖ template string
36. Demo - OOP
❖ Interface
❖ Supporting ES6 for class-based OOP
❖ Inheritance
❖ public, protected and private members
❖ Modules
❖ Functions
❖ Mixins