SlideShare a Scribd company logo
Practical TypeScript with AngularJS
Typescript 102
Bob Goodearl
RGood Software
www.RGoodSoftware.com
Bob German
BlueMetal
www.bluemetal.com
Boston Code Camp 25 - Thanks to our Sponsors!
• Platinum
• Gold
• Silver
• Bronze
• In-Kind Donations
Bob German
Bob Goodearl
• Blog: http://bob1german.com/
• Linked In:
https://www.linkedin.com/in/bgerman
• Twitter: @Bob1German
• Email: bobg@bluemetal.com
• Website: http://www.rgoodsoftware.com
• Linked In:
https://www.linkedin.com/in/bgoodearl
• Email: bgoodearl@rgoodsoftware.com
Presenters
Agenda
• TypeScript Widget
• Modules
• Controllers
• Services
• TypeScript Definitions for REST Calls
• TypeScript SPA with ASP.NET MVC
• Anatomy of an AngularJS/MVC/TypeScript web app
Setup steps:
• Install VS Code
• Install Node (https://nodejs.org/en/download)
• npm install –g typescript
• Ensure no old versions of tsc are on your path; VS
adds:
C:Program Files (x86)Microsoft
SDKsTypeScript1.0
• In VS Code create tsconfig.json in the root of your
folder
{
"compilerOptions": {
"target": "es5“,
"sourceMap": true
}
}
• Use Ctrl+Shift+B to build – first time click the
error to define a default task runner
Edit task runner and un-comment the 2nd
example in the default
• npm install –g http-server
(In a command prompt, run http-server and
browse to http://localhost:8080/)
VS Code Environment
Setup steps:
• Install Visual Studio
• For VS2012 or 2013, install TypeScript extension
• Build and debug the usual way
• Consider WebEssentials for side by side TypeScript
and JavaScript view
(does not work in VS2015)
Visual Studio Environment
• Commonly used on the Internet called ”Web
Widgets”, ”Plugins”, ”Embeds”, etc.
• It’s just a clever piece of HTML and
Javascript that acts like a web part
• Often deployed by authors/end users
seperately from the hosting application
• Very handy in SharePoint and other content
management systems
What is a widget?
What makes a good widget?
1
ISOLATED – so they won’t interfere with other
widgets or the rest of the page
Can you run multiple copies of the widget on a
page?
2
EFFICIENT – so they load quickly Does the page get noticeably slower as you add
widgets?
3
SELF-CONTAINED – so they’re easy to reuse Does the widget work without special page elements
such as element ID’s, scripts, and CSS references?
4
MODERN – so they’re easier to write and maintain Is the widget written in a modern JavaScript
framework such as AngularJS or Knockout?
JavaScript Library allows you to run multiple Angular* apps on a page …
<div> <!-- ng-app=“HelloApp” -->
<div ng-controller="main as vm">
<h1>Hello{{vm.space()}}{{vm.name}}!</h1>
Who should I say hello to?
<input type="text" ng-model="vm.name" />
</div>
<!-- Widget Wrangler loads scripts and boots the app -->
<script type="text/javascript" src="pnp-ww.js“
ww-appName="HelloApp“
ww-appType="Angular“
ww-appScripts='[{"src": “~/angular.min.js", "priority":0},
{"src": “~/script.js", "priority":1}]'>
</script>
</div>
Widget Wrangler
* Also works with any JavaScript framework – or none at all
demo
AngularJS Widget in TypeScript
• Model
• Controller
• Service
• TypeScript Definitions for REST services
Typescript 102   angular and type script
demo
AngularJS Widget in TypeScript
• Model
• Controller
• Service
• TypeScript Definitions for REST services
Anatomy of an
AngularJS/MVC/TypeScript web app
• Why Integrate AngularJS and MVC?
• Why add TypeScript?
• Open source code you can experiment with
• http://bit.ly/MvcNgTsDemo
• Lessons Learned
demo
MVC5NgTsDemo
Generating TypeScript definitions
• Experiments with TypeLite
http://bit.ly/1WW9ckN
• Other options (not yet explored)
• Typewriter extension for Visual Studio
http://bit.ly/VsX-Typewriter
Resources
Session Materials
and Code Samples
• http://bit.ly/bcc25ts102
TypeScript Playground
• http://bit.ly/TSPlayground
TS Def’ns from JSON
• http://json2ts.com/
An Insight company
Thank you.
Bob Goodearl
Bob German

More Related Content

What's hot (20)

Ionic
Ionic
BalajiBas1
 
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
funkatron
 
Building Mobile Cross-Platform Apps with the Cloud and Push Notifications
Building Mobile Cross-Platform Apps with the Cloud and Push Notifications
Nick Landry
 
Xamarin
Xamarin
Software Infrastructure
 
Introduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet Westide
James Montemagno
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
Xamarin
 
Hybrid Mobile App Development - Xamarin
Hybrid Mobile App Development - Xamarin
Deepu S Nath
 
Introduction to xamarin
Introduction to xamarin
Prabhat gangwar
 
What's New in Xamarin? - Santo Domingo
What's New in Xamarin? - Santo Domingo
James Montemagno
 
Cross platform mobile web apps
Cross platform mobile web apps
James Pearce
 
Ionic framework
Ionic framework
Software Infrastructure
 
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
CodeValue
 
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4
Xamarin
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.Forms
James Montemagno
 
Introduction to CocosSharp
Introduction to CocosSharp
James Montemagno
 
Xamarin Forms
Xamarin Forms
Rui Marinho
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
Cihad Horuzoğlu
 
Highlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conference
Christopher Miller
 
Js frameworks
Js frameworks
ParagKhalas
 
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Desktop RIAs with PHP, HTML & Javascript in AIR
funkatron
 
Building Mobile Cross-Platform Apps with the Cloud and Push Notifications
Building Mobile Cross-Platform Apps with the Cloud and Push Notifications
Nick Landry
 
Introduction to Mobile Development with Xamarin -DotNet Westide
Introduction to Mobile Development with Xamarin -DotNet Westide
James Montemagno
 
Native App Development for iOS, Android, and Windows with Visual Studio
Native App Development for iOS, Android, and Windows with Visual Studio
Xamarin
 
Hybrid Mobile App Development - Xamarin
Hybrid Mobile App Development - Xamarin
Deepu S Nath
 
What's New in Xamarin? - Santo Domingo
What's New in Xamarin? - Santo Domingo
James Montemagno
 
Cross platform mobile web apps
Cross platform mobile web apps
James Pearce
 
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
Amir Zuker: Building web apps with web assembly and blazor - Architecture Nex...
CodeValue
 
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin University Presents: Building Your First Intelligent App with Xamarin...
Xamarin
 
Native i os, android, and windows development in c# with xamarin 4
Native i os, android, and windows development in c# with xamarin 4
Xamarin
 
Visual Studio Toolbox - Introduction To Xamarin.Forms
Visual Studio Toolbox - Introduction To Xamarin.Forms
James Montemagno
 
Introduction to CocosSharp
Introduction to CocosSharp
James Montemagno
 
Hybrid Apps with Angular & Ionic Framework
Hybrid Apps with Angular & Ionic Framework
Cihad Horuzoğlu
 
Highlights from the Xamarin Evolve 2016 conference
Highlights from the Xamarin Evolve 2016 conference
Christopher Miller
 

Viewers also liked (20)

Typescript 101 introduction
Typescript 101 introduction
Bob German
 
Why learn french
Why learn french
ifinde
 
Intro to behavioural law & economics
Intro to behavioural law & economics
Albert Sanchez Graells
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien
 
From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013
bgerman
 
Introduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft Graph
SPC Adriatics
 
Building Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJS
bgerman
 
Creating a Great User Experience in SharePoint by Marc Anderson - SPTechCon
Creating a Great User Experience in SharePoint by Marc Anderson - SPTechCon
SPTechCon
 
Leveraging User Profiles and MySites
Leveraging User Profiles and MySites
Derek Cash-Peterson
 
Collab365 Global Summit Slides
Collab365 Global Summit Slides
Rick Van Rousselt
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection Europe
Rick Van Rousselt
 
European SharePoint Conference - TH3
European SharePoint Conference - TH3
Rick Van Rousselt
 
Next Gen Portal in Office 365: April 2015. SUGUK
Next Gen Portal in Office 365: April 2015. SUGUK
pearce.alex
 
Microsoft PowerApps Introduction by Usama Wahab Khan MVP
Microsoft PowerApps Introduction by Usama Wahab Khan MVP
Usama Wahab Khan Cloud, Data and AI
 
Real World SharePoint Debacles
Real World SharePoint Debacles
Matthew J. Bailey , MCT
 
My slides from SharePoint Saturday Oslo
My slides from SharePoint Saturday Oslo
Rick Van Rousselt
 
DWCNZ - Content Types: Love Them or Lose It
DWCNZ - Content Types: Love Them or Lose It
Marc D Anderson
 
Office 365 Groups: Deep Dive
Office 365 Groups: Deep Dive
pearce.alex
 
Managing permissions in SharePoint
Managing permissions in SharePoint
pearce.alex
 
Next Generation Portals: Office 365
Next Generation Portals: Office 365
pearce.alex
 
Typescript 101 introduction
Typescript 101 introduction
Bob German
 
Why learn french
Why learn french
ifinde
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien
 
From Solutions to Apps - Moving to SP2013
From Solutions to Apps - Moving to SP2013
bgerman
 
Introduction to AngularJS with the Microsoft Graph
Introduction to AngularJS with the Microsoft Graph
SPC Adriatics
 
Building Flexible SharePoint Solutions with AngularJS
Building Flexible SharePoint Solutions with AngularJS
bgerman
 
Creating a Great User Experience in SharePoint by Marc Anderson - SPTechCon
Creating a Great User Experience in SharePoint by Marc Anderson - SPTechCon
SPTechCon
 
Leveraging User Profiles and MySites
Leveraging User Profiles and MySites
Derek Cash-Peterson
 
Collab365 Global Summit Slides
Collab365 Global Summit Slides
Rick Van Rousselt
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection Europe
Rick Van Rousselt
 
European SharePoint Conference - TH3
European SharePoint Conference - TH3
Rick Van Rousselt
 
Next Gen Portal in Office 365: April 2015. SUGUK
Next Gen Portal in Office 365: April 2015. SUGUK
pearce.alex
 
My slides from SharePoint Saturday Oslo
My slides from SharePoint Saturday Oslo
Rick Van Rousselt
 
DWCNZ - Content Types: Love Them or Lose It
DWCNZ - Content Types: Love Them or Lose It
Marc D Anderson
 
Office 365 Groups: Deep Dive
Office 365 Groups: Deep Dive
pearce.alex
 
Managing permissions in SharePoint
Managing permissions in SharePoint
pearce.alex
 
Next Generation Portals: Office 365
Next Generation Portals: Office 365
pearce.alex
 
Ad

Similar to Typescript 102 angular and type script (20)

TypeScript and SharePoint Framework
TypeScript and SharePoint Framework
Bob German
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
Rainer Stropek
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
Igor Talevski
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
Angular js
Angular js
Baldeep Sohal
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
Angular js
Angular js
Mauro Servienti
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
Feedback using Angularjs + Typescript at Serenytics
Feedback using Angularjs + Typescript at Serenytics
Adrien Chauve
 
Pengenalan AngularJS
Pengenalan AngularJS
Edi Santoso
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
The future of web development write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
AngularJS 101
AngularJS 101
Houssem Yahiaoui
 
AngularJS and SPA
AngularJS and SPA
Lorenzo Dematté
 
Angular js book
Angular js book
Kamlesh Singh
 
Angularjs
Angularjs
Heinrrich Facho
 
Angularjs
Angularjs
Mustafa Juma
 
The Basics Angular JS
The Basics Angular JS
OrisysIndia
 
AngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
TypeScript and SharePoint Framework
TypeScript and SharePoint Framework
Bob German
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
Rainer Stropek
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
Igor Talevski
 
Introduction to angular with a simple but complete project
Introduction to angular with a simple but complete project
Jadson Santos
 
Walk in the shoe of angular
Walk in the shoe of angular
Fiyaz Hasan
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
Feedback using Angularjs + Typescript at Serenytics
Feedback using Angularjs + Typescript at Serenytics
Adrien Chauve
 
Pengenalan AngularJS
Pengenalan AngularJS
Edi Santoso
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
Mark Roden
 
The future of web development write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
Mark Leusink
 
The Basics Angular JS
The Basics Angular JS
OrisysIndia
 
AngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
Ad

More from Bob German (20)

Introduction to the Microsoft Bot Framework v4
Introduction to the Microsoft Bot Framework v4
Bob German
 
Adaptive cards 101
Adaptive cards 101
Bob German
 
Introduction to Teams Development - North American Collaboration Summit
Introduction to Teams Development - North American Collaboration Summit
Bob German
 
Future-proof Development for Classic SharePoint
Future-proof Development for Classic SharePoint
Bob German
 
Azure for SharePoint Developers - Workshop - Part 4: Bots
Azure for SharePoint Developers - Workshop - Part 4: Bots
Bob German
 
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Bob German
 
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Bob German
 
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Bob German
 
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Bob German
 
Azure AD for browser-based application developers
Azure AD for browser-based application developers
Bob German
 
Mastering Azure Functions
Mastering Azure Functions
Bob German
 
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Bob German
 
Modern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the Ugly
Bob German
 
Developing JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Introduction to TypeScript
Introduction to TypeScript
Bob German
 
Developing JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
German introduction to sp framework
German introduction to sp framework
Bob German
 
SPSNYC - Next Generation Portals
SPSNYC - Next Generation Portals
Bob German
 
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Bob German
 
Enterprise Content Management + SharePoint 2013 - SPSNH
Enterprise Content Management + SharePoint 2013 - SPSNH
Bob German
 
Introduction to the Microsoft Bot Framework v4
Introduction to the Microsoft Bot Framework v4
Bob German
 
Adaptive cards 101
Adaptive cards 101
Bob German
 
Introduction to Teams Development - North American Collaboration Summit
Introduction to Teams Development - North American Collaboration Summit
Bob German
 
Future-proof Development for Classic SharePoint
Future-proof Development for Classic SharePoint
Bob German
 
Azure for SharePoint Developers - Workshop - Part 4: Bots
Azure for SharePoint Developers - Workshop - Part 4: Bots
Bob German
 
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Bob German
 
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Bob German
 
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Bob German
 
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Bob German
 
Azure AD for browser-based application developers
Azure AD for browser-based application developers
Bob German
 
Mastering Azure Functions
Mastering Azure Functions
Bob German
 
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Bob German
 
Modern SharePoint, the Good, the Bad, and the Ugly
Modern SharePoint, the Good, the Bad, and the Ugly
Bob German
 
Developing JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
Introduction to TypeScript
Introduction to TypeScript
Bob German
 
Developing JavaScript Widgets
Developing JavaScript Widgets
Bob German
 
German introduction to sp framework
German introduction to sp framework
Bob German
 
SPSNYC - Next Generation Portals
SPSNYC - Next Generation Portals
Bob German
 
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Bob German
 
Enterprise Content Management + SharePoint 2013 - SPSNH
Enterprise Content Management + SharePoint 2013 - SPSNH
Bob German
 

Recently uploaded (20)

OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Agile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Looking for a BIRT Report Alternative Here’s Why Helical Insight Stands Out.pdf
Looking for a BIRT Report Alternative Here’s Why Helical Insight Stands Out.pdf
Varsha Nayak
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Making significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
IBM Rational Unified Process For Software Engineering - Introduction
IBM Rational Unified Process For Software Engineering - Introduction
Gaurav Sharma
 
Agile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
Plooma is a writing platform to plan, write, and shape books your way
Plooma is a writing platform to plan, write, and shape books your way
Plooma
 
Looking for a BIRT Report Alternative Here’s Why Helical Insight Stands Out.pdf
Looking for a BIRT Report Alternative Here’s Why Helical Insight Stands Out.pdf
Varsha Nayak
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
Women in Tech: Marketo Engage User Group - June 2025 - AJO with AWS
BradBedford3
 

Typescript 102 angular and type script

  • 1. Practical TypeScript with AngularJS Typescript 102 Bob Goodearl RGood Software www.RGoodSoftware.com Bob German BlueMetal www.bluemetal.com
  • 2. Boston Code Camp 25 - Thanks to our Sponsors! • Platinum • Gold • Silver • Bronze • In-Kind Donations
  • 3. Bob German Bob Goodearl • Blog: http://bob1german.com/ • Linked In: https://www.linkedin.com/in/bgerman • Twitter: @Bob1German • Email: [email protected] • Website: http://www.rgoodsoftware.com • Linked In: https://www.linkedin.com/in/bgoodearl • Email: [email protected] Presenters
  • 4. Agenda • TypeScript Widget • Modules • Controllers • Services • TypeScript Definitions for REST Calls • TypeScript SPA with ASP.NET MVC • Anatomy of an AngularJS/MVC/TypeScript web app
  • 5. Setup steps: • Install VS Code • Install Node (https://nodejs.org/en/download) • npm install –g typescript • Ensure no old versions of tsc are on your path; VS adds: C:Program Files (x86)Microsoft SDKsTypeScript1.0 • In VS Code create tsconfig.json in the root of your folder { "compilerOptions": { "target": "es5“, "sourceMap": true } } • Use Ctrl+Shift+B to build – first time click the error to define a default task runner Edit task runner and un-comment the 2nd example in the default • npm install –g http-server (In a command prompt, run http-server and browse to http://localhost:8080/) VS Code Environment
  • 6. Setup steps: • Install Visual Studio • For VS2012 or 2013, install TypeScript extension • Build and debug the usual way • Consider WebEssentials for side by side TypeScript and JavaScript view (does not work in VS2015) Visual Studio Environment
  • 7. • Commonly used on the Internet called ”Web Widgets”, ”Plugins”, ”Embeds”, etc. • It’s just a clever piece of HTML and Javascript that acts like a web part • Often deployed by authors/end users seperately from the hosting application • Very handy in SharePoint and other content management systems What is a widget?
  • 8. What makes a good widget? 1 ISOLATED – so they won’t interfere with other widgets or the rest of the page Can you run multiple copies of the widget on a page? 2 EFFICIENT – so they load quickly Does the page get noticeably slower as you add widgets? 3 SELF-CONTAINED – so they’re easy to reuse Does the widget work without special page elements such as element ID’s, scripts, and CSS references? 4 MODERN – so they’re easier to write and maintain Is the widget written in a modern JavaScript framework such as AngularJS or Knockout?
  • 9. JavaScript Library allows you to run multiple Angular* apps on a page … <div> <!-- ng-app=“HelloApp” --> <div ng-controller="main as vm"> <h1>Hello{{vm.space()}}{{vm.name}}!</h1> Who should I say hello to? <input type="text" ng-model="vm.name" /> </div> <!-- Widget Wrangler loads scripts and boots the app --> <script type="text/javascript" src="pnp-ww.js“ ww-appName="HelloApp“ ww-appType="Angular“ ww-appScripts='[{"src": “~/angular.min.js", "priority":0}, {"src": “~/script.js", "priority":1}]'> </script> </div> Widget Wrangler * Also works with any JavaScript framework – or none at all
  • 10. demo AngularJS Widget in TypeScript • Model • Controller • Service • TypeScript Definitions for REST services
  • 12. demo AngularJS Widget in TypeScript • Model • Controller • Service • TypeScript Definitions for REST services
  • 13. Anatomy of an AngularJS/MVC/TypeScript web app • Why Integrate AngularJS and MVC? • Why add TypeScript? • Open source code you can experiment with • http://bit.ly/MvcNgTsDemo • Lessons Learned
  • 15. Generating TypeScript definitions • Experiments with TypeLite http://bit.ly/1WW9ckN • Other options (not yet explored) • Typewriter extension for Visual Studio http://bit.ly/VsX-Typewriter
  • 16. Resources Session Materials and Code Samples • http://bit.ly/bcc25ts102 TypeScript Playground • http://bit.ly/TSPlayground TS Def’ns from JSON • http://json2ts.com/
  • 17. An Insight company Thank you. Bob Goodearl Bob German

Editor's Notes

  • #2: This intermediate level session will build on the earlier introduction to TypeScript by showing examples of TypeScript in action with AngularJS 1.x. Bob German will begin by showing how to build light-weight widgets with Angular and TypeScript that can be deployed almost anywhere. Then Bob Goodearl will show a more advanced example of TypeScript Single Page Applications with Angular and ASP.NET MVC. In order to take advantage of this session, it will be helpful to have a basic understanding of AngularJS and ASP.Net MVC.
  • #14: Talk about: - Application Structure AngularJS routing Generating TypeScript definitions for your WebAPI JSON payloads Date Handling - Lessons Learned: - You don’t get type checking when you go through a non-Typescript framework – e.g. Angular promises - Debugging doesn’t always work as expected; generated variables get confused with their original names Show app first, then… Review app structure Type Safety -