SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
USING
TYPESCRIPT
WITH
ANGULARJS
Jamal O’Garro
NYC Camp 2015 / Front-end Camp
July 16, 2015
Software Engineer + Instructor
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
• TypeScript
Overview
• AngularJS
Review
• Sample App
• Takeaways
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WORKSHOP ROADMAP
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
MEET YOUR INSTRUCTOR
• Self-taught developer
• Hip-hop Head, sneakerhead, part-time A&R,
painter and photographer extraordinaire
• Secretly in love with Finance and Economics
• True Knicks, Yankees + Giants fan!!!
• Enjoys teaching + mentoring
• Organizer: Code Crew, MEAN NYC, I CODE
NY
• Languages: JavaScript, TypeScript, Ruby,
Python, C, Objective-C, Swift, Haskell
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
CAREER ROADMAP
INTRO TO TYPESCRIPT
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHAT IS TYPESCRIPT?
• Superset of JavaScript
• JavaScript w/ Strong Typing + Other features
• Made by Microsoft
• Will be supported in Angular 2.0
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHAT ARE TYPESCRIPT’S GOALS?
• To statically identify constructs that are most likely to
cause errors
• To provide a mechanism for organizing large code bases
• To be a language for large scale JavaScript applications
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
THE PROS
• Optional strong typing for a dynamically typed language
• Since it compiles down to JavaScript you can easily switch from
JavaScript to plain JS
• Allows us to use proposed ES6/2015 features now
• Has a more OOP feel (good for Java/C#/etc. devs)
• Easy for JavaScript developers to migrate to
• Helps us write fewer unit tests
• Runs on any browser, host or operating system
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
ES6 FEATURES NOW
• Classes
• Classical-style Inheritance
• Modules
• Arrow functions
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
MORE COOL STUFF!
• Interfaces
• Optionals
• Generics
• Type Inference
• Declaration Files
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
THE CONS
• “Slower” development time
• Lack of support for some third-party libraries
• An extra step by compiling code before running in
browser
• Still vulnerable to JavaScript gotchas so you need to
know JavaScript!
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
ALTERNATIVES
• Dart
• CoffeeScript
• ClojureScript
• Fay
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHY USE TYPESCRIPT?
• Building enterprise level applications
• Helps prevent bugs by enforcing code organization
• Makes your JS slightly easier to read
• Enforces good coding practices
• Helps make your JavaScript more Object-oriented
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
LET’S WRITE SOME CODE!
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
ANGULAR REVIEW
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHAT IS ANGULARJS?
• Framework for building single-page applications
• Based on service based architecture, data binding and
dependency injection
• Open source and maintained by Google
• Is often referred to as being a MV* framework
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
ANGULAR PHILOSOPHY
• What HTML would have been if it were created today
• HTML should be dynamic
• Code should be modular and easy to test
• Components should be reusable
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHY USE ANGULAR?
• Rapid development
• Code organization
• Performance
• Easy to test
• Community
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
MVVM DESIGN PATTERN
BROWSER
VIEW VIEWMODEL MODEL
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
DEPENDENCY INJECTION
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
SERVICE BASED ARCHITECTURE
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
FACTORY/SERVICE
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
LET’S BUILD OUR APP!
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
LESSONS LEARNED
• Though it helps make your code more bullet-proof it does take longer
to write code using TypeScript
• The slightly slower development comes in handy when you have less
bugs to fix
• Don’t fall into the “any” trap
• Run into some issues with writing test coverage on compiled
TypeScript
• Try not to mix JS and TypeScript together
• Gradually migrate to TS and then convert your JS over
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
WHAT’S NEXT FOR TS + ANGULAR?
• Will ship with Angular by default though you can still use
Vanilla JS
• Some AtScript features will merge with TypeScript
• TypeScript will get more ES6 and ES7 features including
generators, symbols, let/const, async/await
• Heavy co-development between both Google and Microsoft
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
RESOURCES
• DefinitelyTyped
• TSLint
• TypeScript Playground
• TypeScript Reference
• TypeScript Roadmap
• IDEs: Visual Studio / Webstorm (have TypeScript support)
• Angular.io
• r/angularjs
• r/typescript
CODE CREW | USING TYPESCRIPT WITH ANGULARJS
THANKS MUCH!!!
Jamal O’Garro
NYC Camp 2015 / Front-end Camp
July 16, 2015
Software Engineer + Instructor
CODE CREW | USING TYPESCRIPT WITH ANGULARJS

Mais conteúdo relacionado

Mais procurados

What is Angular version 4?
What is Angular version 4?What is Angular version 4?
What is Angular version 4?Troy Miles
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React NativeFITC
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"Itaru Kitagawa
 
PPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPaddy Lock
 
End-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScriptEnd-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScriptGil Fink
 
1.3にBrowserify組み合わせてイベント駆動にした話
1.3にBrowserify組み合わせてイベント駆動にした話1.3にBrowserify組み合わせてイベント駆動にした話
1.3にBrowserify組み合わせてイベント駆動にした話Okuno Kentaro
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2Dhyego Fernando
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developersQuick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developersPaweł Żurowski
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS DevsBarak Cohen
 
Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Fabio Biondi
 
Angular CLI : HelloWorld
Angular CLI : HelloWorldAngular CLI : HelloWorld
Angular CLI : HelloWorldnikspatel007
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react nativeDani Akash
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core ConceptsFabio Biondi
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React NativeTadeu Zagallo
 
Angular 4 and TypeScript
Angular 4 and TypeScriptAngular 4 and TypeScript
Angular 4 and TypeScriptAhmed El-Kady
 

Mais procurados (20)

What is Angular version 4?
What is Angular version 4?What is Angular version 4?
What is Angular version 4?
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React Native
 
React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"React UI Development: Introduction to "UI Component as API"
React UI Development: Introduction to "UI Component as API"
 
PPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPPT on Angular 2 Development Tutorial
PPT on Angular 2 Development Tutorial
 
End-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScriptEnd-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScript
 
ReactJS.NET
ReactJS.NETReactJS.NET
ReactJS.NET
 
1.3にBrowserify組み合わせてイベント駆動にした話
1.3にBrowserify組み合わせてイベント駆動にした話1.3にBrowserify組み合わせてイベント駆動にした話
1.3にBrowserify組み合わせてイベント駆動にした話
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 
React Native
React NativeReact Native
React Native
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developersQuick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developers
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
 
Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"Introduction for Master Class "Amazing Reactive Forms"
Introduction for Master Class "Amazing Reactive Forms"
 
Angular CLI : HelloWorld
Angular CLI : HelloWorldAngular CLI : HelloWorld
Angular CLI : HelloWorld
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core Concepts
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
Angular 2
Angular 2Angular 2
Angular 2
 
Angular 4 and TypeScript
Angular 4 and TypeScriptAngular 4 and TypeScript
Angular 4 and TypeScript
 
Angular2
Angular2Angular2
Angular2
 

Destaque

Building Better AngularJS 1.X Apps With TypeScript
Building Better AngularJS 1.X Apps With TypeScriptBuilding Better AngularJS 1.X Apps With TypeScript
Building Better AngularJS 1.X Apps With TypeScriptColdFusionConference
 
Angular2 / Typescript symposium Versusmind
Angular2 / Typescript symposium VersusmindAngular2 / Typescript symposium Versusmind
Angular2 / Typescript symposium VersusmindPhilippe Didiergeorges
 
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)David Pichsenmeister
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
Building Angular 2.0 applications with TypeScript
Building Angular 2.0 applications with TypeScriptBuilding Angular 2.0 applications with TypeScript
Building Angular 2.0 applications with TypeScriptMSDEVMTL
 
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式Will Huang
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript SeminarHaim Michael
 
play! scala file resource handling and image resizing
play! scala file resource handling and image resizingplay! scala file resource handling and image resizing
play! scala file resource handling and image resizingDavid Pichsenmeister
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviWinston Levi
 

Destaque (12)

AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
Building Better AngularJS 1.X Apps With TypeScript
Building Better AngularJS 1.X Apps With TypeScriptBuilding Better AngularJS 1.X Apps With TypeScript
Building Better AngularJS 1.X Apps With TypeScript
 
Angular2 / Typescript symposium Versusmind
Angular2 / Typescript symposium VersusmindAngular2 / Typescript symposium Versusmind
Angular2 / Typescript symposium Versusmind
 
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)
The Hitchhikers Guide To Html5 Offline Strategies (+firefoxOS)
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
Building Angular 2.0 applications with TypeScript
Building Angular 2.0 applications with TypeScriptBuilding Angular 2.0 applications with TypeScript
Building Angular 2.0 applications with TypeScript
 
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
TypeScript 開發實戰:開發即時互動的 html5 websocket 聊天室應用程式
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript Seminar
 
play! scala file resource handling and image resizing
play! scala file resource handling and image resizingplay! scala file resource handling and image resizing
play! scala file resource handling and image resizing
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
Introduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston LeviIntroduction to TypeScript by Winston Levi
Introduction to TypeScript by Winston Levi
 

Semelhante a Using TypeScript with Angular

Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsColdFusionConference
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better appsdevObjective
 
SPUnite17 TypeScript for SharePoint Developers
SPUnite17 TypeScript for SharePoint DevelopersSPUnite17 TypeScript for SharePoint Developers
SPUnite17 TypeScript for SharePoint DevelopersNCCOMMS
 
Get Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI SpecGet Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI SpecAdam Paxton
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Tony Tam
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGil Fink
 
Benefits of Typescript and Javascript Limitations
Benefits of Typescript and Javascript LimitationsBenefits of Typescript and Javascript Limitations
Benefits of Typescript and Javascript LimitationsSrinivasa Perumal
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteChristian Heilmann
 
Javascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumJavascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumTechday7
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScriptJustin Wendlandt
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code ReviewMilan Vukoje
 
Typescript: JS code just got better!
Typescript: JS code just got better!Typescript: JS code just got better!
Typescript: JS code just got better!amit bezalel
 
Javascript as universal language
Javascript as universal languageJavascript as universal language
Javascript as universal languageRonald Harmsen
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierMiroslav Resetar
 
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft Graph
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft GraphSharePoint Fest Chicago - Introduction to AngularJS with the Microsoft Graph
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft GraphSébastien Levert
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)Alvaro Sanchez-Mariscal
 
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJungryul Choi
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET Dmytro Mindra
 

Semelhante a Using TypeScript with Angular (20)

Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
Using type script to build better apps
Using type script to build better appsUsing type script to build better apps
Using type script to build better apps
 
SPUnite17 TypeScript for SharePoint Developers
SPUnite17 TypeScript for SharePoint DevelopersSPUnite17 TypeScript for SharePoint Developers
SPUnite17 TypeScript for SharePoint Developers
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Get Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI SpecGet Your Node.js API Swaggering with OpenAPI Spec
Get Your Node.js API Swaggering with OpenAPI Spec
 
Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)Swagger APIs for Humans and Robots (Gluecon)
Swagger APIs for Humans and Robots (Gluecon)
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
Benefits of Typescript and Javascript Limitations
Benefits of Typescript and Javascript LimitationsBenefits of Typescript and Javascript Limitations
Benefits of Typescript and Javascript Limitations
 
Quo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynoteQuo vadis, JavaScript? Devday.pl keynote
Quo vadis, JavaScript? Devday.pl keynote
 
Javascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to TitaniumJavascript Best Practices and Intro to Titanium
Javascript Best Practices and Intro to Titanium
 
Angular Owin Katana TypeScript
Angular Owin Katana TypeScriptAngular Owin Katana TypeScript
Angular Owin Katana TypeScript
 
Coding Standard And Code Review
Coding Standard And Code ReviewCoding Standard And Code Review
Coding Standard And Code Review
 
Typescript: JS code just got better!
Typescript: JS code just got better!Typescript: JS code just got better!
Typescript: JS code just got better!
 
Javascript as universal language
Javascript as universal languageJavascript as universal language
Javascript as universal language
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft Graph
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft GraphSharePoint Fest Chicago - Introduction to AngularJS with the Microsoft Graph
SharePoint Fest Chicago - Introduction to AngularJS with the Microsoft Graph
 
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
DevQA: make your testers happier with Groovy, Spock and Geb (Greach 2014)
 
JavaScript: Past, Present, Future
JavaScript: Past, Present, FutureJavaScript: Past, Present, Future
JavaScript: Past, Present, Future
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 

Mais de Jamal Sinclair O'Garro (14)

A Look at TensorFlow.js
A Look at TensorFlow.jsA Look at TensorFlow.js
A Look at TensorFlow.js
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
 
Intro to ionic 2
Intro to ionic 2Intro to ionic 2
Intro to ionic 2
 
Intro to ES6 / ES2015
Intro to ES6 / ES2015Intro to ES6 / ES2015
Intro to ES6 / ES2015
 
The Ten Code Commandments
The Ten Code CommandmentsThe Ten Code Commandments
The Ten Code Commandments
 
Intro to UI-Router/TypeScript
Intro to UI-Router/TypeScriptIntro to UI-Router/TypeScript
Intro to UI-Router/TypeScript
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 
Intro to iOS Development
Intro to iOS DevelopmentIntro to iOS Development
Intro to iOS Development
 
Intro to rails 2_kg_edited
Intro to rails 2_kg_editedIntro to rails 2_kg_edited
Intro to rails 2_kg_edited
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Intro to javascript (4 week)
Intro to javascript (4 week)Intro to javascript (4 week)
Intro to javascript (4 week)
 
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
 
Intro to Programming
Intro to ProgrammingIntro to Programming
Intro to Programming
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Using TypeScript with Angular

  • 1. USING TYPESCRIPT WITH ANGULARJS Jamal O’Garro NYC Camp 2015 / Front-end Camp July 16, 2015 Software Engineer + Instructor CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 2. • TypeScript Overview • AngularJS Review • Sample App • Takeaways CODE CREW | USING TYPESCRIPT WITH ANGULARJS WORKSHOP ROADMAP
  • 3. CODE CREW | USING TYPESCRIPT WITH ANGULARJS MEET YOUR INSTRUCTOR • Self-taught developer • Hip-hop Head, sneakerhead, part-time A&R, painter and photographer extraordinaire • Secretly in love with Finance and Economics • True Knicks, Yankees + Giants fan!!! • Enjoys teaching + mentoring • Organizer: Code Crew, MEAN NYC, I CODE NY • Languages: JavaScript, TypeScript, Ruby, Python, C, Objective-C, Swift, Haskell
  • 4. CODE CREW | USING TYPESCRIPT WITH ANGULARJS CAREER ROADMAP
  • 5. INTRO TO TYPESCRIPT CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 6. WHAT IS TYPESCRIPT? • Superset of JavaScript • JavaScript w/ Strong Typing + Other features • Made by Microsoft • Will be supported in Angular 2.0 CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 7. WHAT ARE TYPESCRIPT’S GOALS? • To statically identify constructs that are most likely to cause errors • To provide a mechanism for organizing large code bases • To be a language for large scale JavaScript applications CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 8. THE PROS • Optional strong typing for a dynamically typed language • Since it compiles down to JavaScript you can easily switch from JavaScript to plain JS • Allows us to use proposed ES6/2015 features now • Has a more OOP feel (good for Java/C#/etc. devs) • Easy for JavaScript developers to migrate to • Helps us write fewer unit tests • Runs on any browser, host or operating system CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 9. ES6 FEATURES NOW • Classes • Classical-style Inheritance • Modules • Arrow functions CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 10. MORE COOL STUFF! • Interfaces • Optionals • Generics • Type Inference • Declaration Files CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 11. THE CONS • “Slower” development time • Lack of support for some third-party libraries • An extra step by compiling code before running in browser • Still vulnerable to JavaScript gotchas so you need to know JavaScript! CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 12. ALTERNATIVES • Dart • CoffeeScript • ClojureScript • Fay CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 13. WHY USE TYPESCRIPT? • Building enterprise level applications • Helps prevent bugs by enforcing code organization • Makes your JS slightly easier to read • Enforces good coding practices • Helps make your JavaScript more Object-oriented CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 14. LET’S WRITE SOME CODE! CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 15. ANGULAR REVIEW CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 16. WHAT IS ANGULARJS? • Framework for building single-page applications • Based on service based architecture, data binding and dependency injection • Open source and maintained by Google • Is often referred to as being a MV* framework CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 17. ANGULAR PHILOSOPHY • What HTML would have been if it were created today • HTML should be dynamic • Code should be modular and easy to test • Components should be reusable CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 18. WHY USE ANGULAR? • Rapid development • Code organization • Performance • Easy to test • Community CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 19. MVVM DESIGN PATTERN BROWSER VIEW VIEWMODEL MODEL CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 20. DEPENDENCY INJECTION CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 21. SERVICE BASED ARCHITECTURE CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 22. FACTORY/SERVICE CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 23. LET’S BUILD OUR APP! CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 24. LESSONS LEARNED • Though it helps make your code more bullet-proof it does take longer to write code using TypeScript • The slightly slower development comes in handy when you have less bugs to fix • Don’t fall into the “any” trap • Run into some issues with writing test coverage on compiled TypeScript • Try not to mix JS and TypeScript together • Gradually migrate to TS and then convert your JS over CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 25. WHAT’S NEXT FOR TS + ANGULAR? • Will ship with Angular by default though you can still use Vanilla JS • Some AtScript features will merge with TypeScript • TypeScript will get more ES6 and ES7 features including generators, symbols, let/const, async/await • Heavy co-development between both Google and Microsoft CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 26. RESOURCES • DefinitelyTyped • TSLint • TypeScript Playground • TypeScript Reference • TypeScript Roadmap • IDEs: Visual Studio / Webstorm (have TypeScript support) • Angular.io • r/angularjs • r/typescript CODE CREW | USING TYPESCRIPT WITH ANGULARJS
  • 27. THANKS MUCH!!! Jamal O’Garro NYC Camp 2015 / Front-end Camp July 16, 2015 Software Engineer + Instructor CODE CREW | USING TYPESCRIPT WITH ANGULARJS