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

What's hot (19)

PPT
TypeScript Presentation
Patrick John Pacaña
 
PPTX
TypeScript
Udaiappa Ramachandran
 
PPTX
TypeScript Overview
Aniruddha Chakrabarti
 
PPTX
TypeScript intro
Ats Uiboupin
 
PPTX
Typescript in 30mins
Udaya Kumar
 
PDF
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
PPT
Learning typescript
Alexandre Marreiros
 
PPTX
Typescript Fundamentals
Sunny Sharma
 
PDF
Introduction to Angular for .NET Developers
Laurent Duveau
 
PPTX
Introducing type script
Remo Jansen
 
PDF
TypeScript 101 - Studio Session - Accenture Liquid Studio
Frances Coronel
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PDF
Introduction to TypeScript
NexThoughts Technologies
 
PDF
Using type script to build better apps
ColdFusionConference
 
PDF
Intro to Crystal Programming Language
Adler Hsieh
 
PPTX
TypeScript 101
rachelterman
 
PDF
Introduction to TypeScript by Winston Levi
Winston Levi
 
PDF
A brief intro to RubyMotion
Kamil Lelonek
 
PPTX
Introduction To Rust Language - Chester Devs
Andy Lowry
 
TypeScript Presentation
Patrick John Pacaña
 
TypeScript Overview
Aniruddha Chakrabarti
 
TypeScript intro
Ats Uiboupin
 
Typescript in 30mins
Udaya Kumar
 
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
Learning typescript
Alexandre Marreiros
 
Typescript Fundamentals
Sunny Sharma
 
Introduction to Angular for .NET Developers
Laurent Duveau
 
Introducing type script
Remo Jansen
 
TypeScript 101 - Studio Session - Accenture Liquid Studio
Frances Coronel
 
TypeScript - An Introduction
NexThoughts Technologies
 
Introduction to TypeScript
NexThoughts Technologies
 
Using type script to build better apps
ColdFusionConference
 
Intro to Crystal Programming Language
Adler Hsieh
 
TypeScript 101
rachelterman
 
Introduction to TypeScript by Winston Levi
Winston Levi
 
A brief intro to RubyMotion
Kamil Lelonek
 
Introduction To Rust Language - Chester Devs
Andy Lowry
 

Viewers also liked (17)

PDF
Webcomponents v2
Dmitry Bakaleinik
 
PPTX
Async patterns in javascript
Ran Wahle
 
PPTX
Responsive ui
Ran Wahle
 
PPTX
Capaces
Inma Ramón Alcaraz
 
PPTX
American graduate 2015
Macamalaxi
 
PDF
Young Crew Newsletter
Oluwaseyi SODOLA
 
PDF
WhitePaper_M-LEx
Somenath Goswami
 
PDF
Convocatoria CEN
Jorge Cortes
 
PPT
Dads' power point presentation
George Roberson
 
PDF
Husqi Design Challenge~3
Pradeep Deulkar
 
PDF
2016 Q1 Morningstar Fund Observer
Kyle Glen Cox
 
PDF
K.Jha Safety Officer Cert. Bunch 1
KAMAKHYA JHA
 
DOCX
Odher scout community
Operator Warnet Vast Raha
 
PPTX
Thesis presentation
Nusrat Khanum ZINIA
 
DOCX
Makalah keganasan
Operator Warnet Vast Raha
 
PPTX
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
PPTX
Introduction to HTTP/2
Ido Flatow
 
Webcomponents v2
Dmitry Bakaleinik
 
Async patterns in javascript
Ran Wahle
 
Responsive ui
Ran Wahle
 
American graduate 2015
Macamalaxi
 
Young Crew Newsletter
Oluwaseyi SODOLA
 
WhitePaper_M-LEx
Somenath Goswami
 
Convocatoria CEN
Jorge Cortes
 
Dads' power point presentation
George Roberson
 
Husqi Design Challenge~3
Pradeep Deulkar
 
2016 Q1 Morningstar Fund Observer
Kyle Glen Cox
 
K.Jha Safety Officer Cert. Bunch 1
KAMAKHYA JHA
 
Odher scout community
Operator Warnet Vast Raha
 
Thesis presentation
Nusrat Khanum ZINIA
 
Makalah keganasan
Operator Warnet Vast Raha
 
Learning ASP.NET 5 and MVC 6
Ido Flatow
 
Introduction to HTTP/2
Ido Flatow
 
Ad

Similar to Getting Started with the TypeScript Language (20)

PDF
One language to rule them all type script
Gil Fink
 
PDF
Building End-to-End Apps Using Typescript
Gil Fink
 
PDF
Building End to-End Web Apps Using TypeScript
Gil Fink
 
PPTX
TypeScript: Basic Features and Compilation Guide
Nascenia IT
 
PPTX
Type script
Mallikarjuna G D
 
PPTX
The advantage of developing with TypeScript
Corley S.r.l.
 
PDF
Type script
srinivaskapa1
 
PPTX
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
PDF
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
PDF
An Introduction to TypeScript
WrapPixel
 
PDF
Using type script to build better apps
devObjective
 
PDF
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
PPTX
Type script
Zunair Shoes
 
PDF
TypeScript for Java Developers
Yakov Fain
 
PDF
TypeScipt - Get Started
Krishnanand Sivaraj
 
PPTX
Complete Notes on Angular 2 and TypeScript
EPAM Systems
 
PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Malla Reddy University
 
PDF
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
PPTX
TypeScript Jump Start
Mostafa
 
PDF
Large Scale JavaScript with TypeScript
Oliver Zeigermann
 
One language to rule them all type script
Gil Fink
 
Building End-to-End Apps Using Typescript
Gil Fink
 
Building End to-End Web Apps Using TypeScript
Gil Fink
 
TypeScript: Basic Features and Compilation Guide
Nascenia IT
 
Type script
Mallikarjuna G D
 
The advantage of developing with TypeScript
Corley S.r.l.
 
Type script
srinivaskapa1
 
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
An Introduction to TypeScript
WrapPixel
 
Using type script to build better apps
devObjective
 
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
Type script
Zunair Shoes
 
TypeScript for Java Developers
Yakov Fain
 
TypeScipt - Get Started
Krishnanand Sivaraj
 
Complete Notes on Angular 2 and TypeScript
EPAM Systems
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Malla Reddy University
 
TypeScript: Angular's Secret Weapon
Laurent Duveau
 
TypeScript Jump Start
Mostafa
 
Large Scale JavaScript with TypeScript
Oliver Zeigermann
 
Ad

More from Gil Fink (20)

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

Recently uploaded (20)

PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
PPTX
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
PPTX
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PDF
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
PDF
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Import Data Form Excel to Tally Services
Tally xperts
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Comprehensive Guide: Shoviv Exchange to Office 365 Migration Tool 2025
Shoviv Software
 
The Role of a PHP Development Company in Modern Web Development
SEO Company for School in Delhi NCR
 
Revolutionizing Code Modernization with AI
KrzysztofKkol1
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Powering GIS with FME and VertiGIS - Peak of Data & AI 2025
Safe Software
 
Revenue streams of the Wazirx clone script.pdf
aaronjeffray
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 

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