SlideShare a Scribd company logo
GETTING STARTED WITH
THE TYPESCRIPT
LANGUAGE
Gil Fink
sparXys CEO
About Me
‱ sparXys CEO and senior consultant
‱ ASP.NET/IIS Microsoft MVP in the last 6 years
‱ Pro Single Page Application Development (Apress)
co-author
‱ 4 Microsoft Official Courses (MOCs) co-author
‱ GDG Rashlatz and ng-conf Israel co-organizer
Agenda
‱ The Why
‱ TypeScript Syntax and Language Features
‱ Building a Simple App with TypeScript
‱ Summary
Wait!
JavaScript?
Are you nuts?
"JavaScript is the assembly
language of the Web"
Erik Meijer
“You can write large
programs in JavaScript. You
just can’t maintain them”
Anders Hejlsberg
JavaScript isn’t Really Bad
‱ JavaScript is really a powerful language:
o Functional
o Dynamic
o Can run everywhere
‱ Huge community
‱ Libraries
‱ Tools
o IDEs
o Debuggers
o Test tools
Some Alternatives
‱ We have several alternatives:
‱ Hard core JavaScript development – my Stockholm syndrome
‱ JavaScript preprocessors
‱ CoffeeScript – http://coffeescript.org
‱ Dart – http://dartlang.org
‱ Clojurescript - https://github.com/clojure/clojurescript
‱ Script# - http://scriptsharp.com/
What is TypeScript?
“TypeScript is a typed superset of JavaScript that
compiles to plain JavaScript” ~typescriptlang.org
Hello TypeScript
Demo
TypeScript is Very
Flexible
Any Browser Any Host
Any OS Tool Support
Some TypeScript Key
Features
Support
standard
JavaScript
code with
static typing
Encapsulation
through classes
and modules
Support for
constructors,
properties and
functions
Interfaces and
enums
support
Lambda and
generics
support
Intellisense
and syntax
checking
‱ Modules
‱ Classes
‱ Arrow functions
‱ Default parameters
‱ Destructuring
‱ Spread and rest
‱ Let and const
‱ for...of
‱ Object literal
methods
‱ Shorthand
properties
‱ Computed
properties
‱ Octal / binary
literals
‱ Symbols
‱ Template strings
Features from the near Future of
the Web (ES2015), Today
It is up to you to
choose the compilation
scenario
From TypeScript to
JavaScript
14
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return “Hi," + this.greeting;
}
}
TypeScript Code JavaScript Code
TypeScript
Compiler
var Greeter = (function () {
function Greeter(message) {
this.greeting = message;
}
Greeter.prototype.greet =
function () {
return “Hi," + this.greeting;
};
return Greeter;
})();
tsc.js
How Good is TypeScript’s
Output?
Some Important Side
Notes
‱ All JavaScript code is TypeScript code, simply copy
and paste
‱ All JavaScript libraries work with TypeScript
TypeScript Type
Annotations
‱ You can add type annotations to variables and
functions
var str: string = ‘hello’; // str is annotated as string
function foo(name: string) : string { // parameter and function annotated
return ‘hello’ + name;
}
TypeScript Types
Type Annotations
Demo
Classes and Interfaces
‱ You can define classes
‱ You can define interfaces
o And implement them later
interface IGreeter {
greet(): void;
}
class Greeter implements IGreeter{
greeting: string;
greet() {
console.log(this.greeting);
}
}
var Greeter = (function () {
function Greeter() {
}
Greeter.prototype.greet = function () {
console.log(this.greeting);
};
return Greeter;
})();
Modules
‱ You define modules to wrap classes, interfaces and
functions
‱ Use import and export keywords
‱module app {
export interface IGreeter {
greet(): void;
}
export class Greeter implements IGreeter {
greeting: string;
greet() {
console.log(this.greeting);
}
}
}
var app;
(function (app) {
var Greeter = (function () {
function Greeter() {
}
Greeter.prototype.greet = function () {
console.log(this.greeting);
};
return Greeter;
})();
app.Greeter = Greeter;
})(app || (app = {}));
Classes, Modules and Interfaces
Demo
Building a Simple End-to-End App with
TypeScript
Demo
Angular 2: Built with
TypeScript
‱ http://blogs.msdn.com/b/typescript/archive/2015/03/05/ang
ular-2-0-built-on-typescript.aspx
‱ http://blogs.msdn.com/b/visualstudio/archive/2015/03/12/a
-preview-of-angular-2-and-typescript-in-visual-studio.aspx
TypeScript Versions
‱ TypeScript 1.0 – 1.5
‱ Typescript 1.6 Beta (released in 2.9)
o React support
o Improved module resolution
o More ES2015 support
‱ TypeScript 2.0 (vNext no release in the near future)
Questions?
Summary
‱ Open source language that compiles into
JavaScript
‱ Key features:
‱ Code encapsulation
‱ Maintainable code
‱ Tooling support
‱ Learn TypeScript today!
Resources
‱ TypeScript – http://www.typescriptlang.org
‱ TypeScript Source Code -
https://github.com/Microsoft/TypeScript
‱ Definitely Typed –
https://github.com/borisyankov/DefinitelyTyped
‱ My Website – http://www.gilfink.net
‱ Follow me on Twitter – @gilfink
Thank You!

More Related Content

PDF
End to-end apps with type script
PDF
One language to rule them all type script
PDF
End-to-End SPA Development using TypeScript
PPTX
TypeScript . the JavaScript developer best friend!
PDF
Power Leveling your TypeScript
PDF
Getting Started with TypeScript
PPTX
Typescript ppt
PPTX
AngularConf2015
End to-end apps with type script
One language to rule them all type script
End-to-End SPA Development using TypeScript
TypeScript . the JavaScript developer best friend!
Power Leveling your TypeScript
Getting Started with TypeScript
Typescript ppt
AngularConf2015

What's hot (19)

PPT
TypeScript Presentation
PPTX
TypeScript
PPTX
TypeScript Overview
PPTX
TypeScript intro
PPTX
Typescript in 30mins
PDF
TypeScript: Angular's Secret Weapon
PPT
Learning typescript
PPTX
Typescript Fundamentals
PDF
Introduction to Angular for .NET Developers
PPTX
Introducing type script
PDF
TypeScript 101 - Studio Session - Accenture Liquid Studio
PDF
TypeScript - An Introduction
PDF
Introduction to TypeScript
PDF
Using type script to build better apps
PDF
Intro to Crystal Programming Language
PPTX
TypeScript 101
PDF
Introduction to TypeScript by Winston Levi
PDF
A brief intro to RubyMotion
PPTX
Introduction To Rust Language - Chester Devs
TypeScript Presentation
TypeScript
TypeScript Overview
TypeScript intro
Typescript in 30mins
TypeScript: Angular's Secret Weapon
Learning typescript
Typescript Fundamentals
Introduction to Angular for .NET Developers
Introducing type script
TypeScript 101 - Studio Session - Accenture Liquid Studio
TypeScript - An Introduction
Introduction to TypeScript
Using type script to build better apps
Intro to Crystal Programming Language
TypeScript 101
Introduction to TypeScript by Winston Levi
A brief intro to RubyMotion
Introduction To Rust Language - Chester Devs
Ad

Viewers also liked (17)

PDF
Webcomponents v2
PPTX
Async patterns in javascript
PPTX
Responsive ui
PPTX
PPTX
American graduate 2015
PDF
Young Crew Newsletter
PDF
WhitePaper_M-LEx
PDF
Convocatoria CEN
PPT
Dads' power point presentation
PDF
Husqi Design Challenge~3
PDF
2016 Q1 Morningstar Fund Observer
PDF
K.Jha Safety Officer Cert. Bunch 1
DOCX
Odher scout community
PPTX
Thesis presentation
DOCX
Makalah keganasan
PPTX
Learning ASP.NET 5 and MVC 6
PPTX
Introduction to HTTP/2
Webcomponents v2
Async patterns in javascript
Responsive ui
American graduate 2015
Young Crew Newsletter
WhitePaper_M-LEx
Convocatoria CEN
Dads' power point presentation
Husqi Design Challenge~3
2016 Q1 Morningstar Fund Observer
K.Jha Safety Officer Cert. Bunch 1
Odher scout community
Thesis presentation
Makalah keganasan
Learning ASP.NET 5 and MVC 6
Introduction to HTTP/2
Ad

Similar to Getting Started with the TypeScript Language (20)

PDF
One language to rule them all type script
PDF
Building End-to-End Apps Using Typescript
PDF
Building End to-End Web Apps Using TypeScript
PPTX
TypeScript: Basic Features and Compilation Guide
PPTX
Type script
PPTX
The advantage of developing with TypeScript
PDF
Type script
PPTX
Getting started with typescript
PDF
TypeScript: coding JavaScript without the pain
PDF
An Introduction to TypeScript
PDF
Using type script to build better apps
PDF
Typescript for the programmers who like javascript
PPTX
Type script
PDF
TypeScript for Java Developers
PDF
TypeScipt - Get Started
PPTX
Complete Notes on Angular 2 and TypeScript
PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
PDF
TypeScript: Angular's Secret Weapon
PPTX
TypeScript Jump Start
PDF
Large Scale JavaScript with TypeScript
One language to rule them all type script
Building End-to-End Apps Using Typescript
Building End to-End Web Apps Using TypeScript
TypeScript: Basic Features and Compilation Guide
Type script
The advantage of developing with TypeScript
Type script
Getting started with typescript
TypeScript: coding JavaScript without the pain
An Introduction to TypeScript
Using type script to build better apps
Typescript for the programmers who like javascript
Type script
TypeScript for Java Developers
TypeScipt - Get Started
Complete Notes on Angular 2 and TypeScript
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
TypeScript: Angular's Secret Weapon
TypeScript Jump Start
Large Scale JavaScript with TypeScript

More from Gil Fink (20)

PDF
Becoming a Tech Speaker
PPTX
Web animation on steroids web animation api
PDF
The Time for Vanilla Web Components has Arrived
PDF
Stencil the time for vanilla web components has arrived
PDF
Stencil the time for vanilla web components has arrived
PDF
Stencil: The Time for Vanilla Web Components has Arrived
PDF
Stencil the time for vanilla web components has arrived
PDF
Being a tech speaker
PDF
Working with Data in Service Workers
PDF
Demystifying Angular Animations
PDF
Redux data flow with angular
PDF
Redux data flow with angular
PDF
Who's afraid of front end databases?
PDF
Web component driven development
PDF
Web components
PDF
Redux data flow with angular 2
PDF
Biological Modeling, Powered by AngularJS
PDF
Who's afraid of front end databases
PDF
Biological modeling, powered by angular js
PDF
Web components the future is here
Becoming a Tech Speaker
Web animation on steroids web animation api
The Time for Vanilla Web Components has Arrived
Stencil the time for vanilla web components has arrived
Stencil the time for vanilla web components has arrived
Stencil: The Time for Vanilla Web Components has Arrived
Stencil the time for vanilla web components has arrived
Being a tech speaker
Working with Data in Service Workers
Demystifying Angular Animations
Redux data flow with angular
Redux data flow with angular
Who's afraid of front end databases?
Web component driven development
Web components
Redux data flow with angular 2
Biological Modeling, Powered by AngularJS
Who's afraid of front end databases
Biological modeling, powered by angular js
Web components the future is here

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Transform Your Business with a Software ERP System
PDF
System and Network Administration Chapter 2
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPT
Introduction Database Management System for Course Database
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Digital Strategies for Manufacturing Companies
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Transform Your Business with a Software ERP System
System and Network Administration Chapter 2
How to Choose the Right IT Partner for Your Business in Malaysia
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
 
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Which alternative to Crystal Reports is best for small or large businesses.pdf
Softaken Excel to vCard Converter Software.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction Database Management System for Course Database
Reimagine Home Health with the Power of Agentic AI​
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Understanding Forklifts - TECH EHS Solution
Computer Software and OS of computer science of grade 11.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms II-SECS-1021-03
Digital Strategies for Manufacturing Companies
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf

Getting Started with the TypeScript Language

  • 1. GETTING STARTED WITH THE TYPESCRIPT LANGUAGE Gil Fink sparXys CEO
  • 2. About Me ‱ sparXys CEO and senior consultant ‱ ASP.NET/IIS Microsoft MVP in the last 6 years ‱ Pro Single Page Application Development (Apress) co-author ‱ 4 Microsoft Official Courses (MOCs) co-author ‱ GDG Rashlatz and ng-conf Israel co-organizer
  • 3. Agenda ‱ The Why ‱ TypeScript Syntax and Language Features ‱ Building a Simple App with TypeScript ‱ Summary
  • 5. "JavaScript is the assembly language of the Web" Erik Meijer
  • 6. “You can write large programs in JavaScript. You just can’t maintain them” Anders Hejlsberg
  • 7. JavaScript isn’t Really Bad ‱ JavaScript is really a powerful language: o Functional o Dynamic o Can run everywhere ‱ Huge community ‱ Libraries ‱ Tools o IDEs o Debuggers o Test tools
  • 8. Some Alternatives ‱ We have several alternatives: ‱ Hard core JavaScript development – my Stockholm syndrome ‱ JavaScript preprocessors ‱ CoffeeScript – http://coffeescript.org ‱ Dart – http://dartlang.org ‱ Clojurescript - https://github.com/clojure/clojurescript ‱ Script# - http://scriptsharp.com/
  • 9. What is TypeScript? “TypeScript is a typed superset of JavaScript that compiles to plain JavaScript” ~typescriptlang.org
  • 11. TypeScript is Very Flexible Any Browser Any Host Any OS Tool Support
  • 12. Some TypeScript Key Features Support standard JavaScript code with static typing Encapsulation through classes and modules Support for constructors, properties and functions Interfaces and enums support Lambda and generics support Intellisense and syntax checking
  • 13. ‱ Modules ‱ Classes ‱ Arrow functions ‱ Default parameters ‱ Destructuring ‱ Spread and rest ‱ Let and const ‱ for...of ‱ Object literal methods ‱ Shorthand properties ‱ Computed properties ‱ Octal / binary literals ‱ Symbols ‱ Template strings Features from the near Future of the Web (ES2015), Today It is up to you to choose the compilation scenario
  • 14. From TypeScript to JavaScript 14 class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet() { return “Hi," + this.greeting; } } TypeScript Code JavaScript Code TypeScript Compiler var Greeter = (function () { function Greeter(message) { this.greeting = message; } Greeter.prototype.greet = function () { return “Hi," + this.greeting; }; return Greeter; })(); tsc.js
  • 15. How Good is TypeScript’s Output?
  • 16. Some Important Side Notes ‱ All JavaScript code is TypeScript code, simply copy and paste ‱ All JavaScript libraries work with TypeScript
  • 17. TypeScript Type Annotations ‱ You can add type annotations to variables and functions var str: string = ‘hello’; // str is annotated as string function foo(name: string) : string { // parameter and function annotated return ‘hello’ + name; }
  • 20. Classes and Interfaces ‱ You can define classes ‱ You can define interfaces o And implement them later interface IGreeter { greet(): void; } class Greeter implements IGreeter{ greeting: string; greet() { console.log(this.greeting); } } var Greeter = (function () { function Greeter() { } Greeter.prototype.greet = function () { console.log(this.greeting); }; return Greeter; })();
  • 21. Modules ‱ You define modules to wrap classes, interfaces and functions ‱ Use import and export keywords ‱module app { export interface IGreeter { greet(): void; } export class Greeter implements IGreeter { greeting: string; greet() { console.log(this.greeting); } } } var app; (function (app) { var Greeter = (function () { function Greeter() { } Greeter.prototype.greet = function () { console.log(this.greeting); }; return Greeter; })(); app.Greeter = Greeter; })(app || (app = {}));
  • 22. Classes, Modules and Interfaces Demo
  • 23. Building a Simple End-to-End App with TypeScript Demo
  • 24. Angular 2: Built with TypeScript ‱ http://blogs.msdn.com/b/typescript/archive/2015/03/05/ang ular-2-0-built-on-typescript.aspx ‱ http://blogs.msdn.com/b/visualstudio/archive/2015/03/12/a -preview-of-angular-2-and-typescript-in-visual-studio.aspx
  • 25. TypeScript Versions ‱ TypeScript 1.0 – 1.5 ‱ Typescript 1.6 Beta (released in 2.9) o React support o Improved module resolution o More ES2015 support ‱ TypeScript 2.0 (vNext no release in the near future)
  • 27. Summary ‱ Open source language that compiles into JavaScript ‱ Key features: ‱ Code encapsulation ‱ Maintainable code ‱ Tooling support ‱ Learn TypeScript today!
  • 28. Resources ‱ TypeScript – http://www.typescriptlang.org ‱ TypeScript Source Code - https://github.com/Microsoft/TypeScript ‱ Definitely Typed – https://github.com/borisyankov/DefinitelyTyped ‱ My Website – http://www.gilfink.net ‱ Follow me on Twitter – @gilfink