SlideShare a Scribd company logo
DEBUGGING AN ANGULAR APP Laurent Duveau
July 5th, 2017
WHO AM I ?
Laurent Duveau
I live in Montreal, Canada
Founder of the Angular Academy
2-day Angular Classroom Training
68 classes in the last 18 months
Montreal, Boston, Quebec, Toronto,
Vancouver, Ottawa, Calgary, London,
Copenhagen…
@LaurentDuveau
2
September!
AGENDA
3
Use TypeScript!
Tip: Json pipe
Angular Language Service
Debug your code!
Augury
Master the Console
Debug RxJS
“Debugging is twice as hard
as writing the code in the
first place. Therefore, if you
write the code as cleverly as
possible, you are, by
definition, not smart enough
to debug it.”
- Brian Kernighan
When everything fails…
Demonstration
Use TypeScript!
TYPESCRIPT…
Is not really something brand new to learn
It is just typed JavaScript (fully compatible with Js ecosystem)
Is used to generate your Js
Easily learnable for Java or C# developers
Latest ES (classes, modules,…) + types, interfaces,
generics, enums, async/await, …
ERRORS AT COMPILE-TIME!
var a = 54
a.trim()
TypeError: undefined
is not a function
var a: string = 54
a.trim()
Cannot convert
‘number’ to ‘string’
JavaScript TypeScript
runtime… compile-time!
“TypeScript? It’s like
coding JavaScript but
without the pain”
- Someone on Hacker News
Demonstration
Json pipe
USE THE JSON PIPE!
component.template.html
<li [title]="product">
{{ product.name }}
</li>
USE THE JSON PIPE!
component.template.html
<li [title]="product | json">
{{ product.name }}
</li>
Demonstration
Angular Language Service
ANGULAR LANGUAGE SERVICE
Editor extension to get validation and
autocompletion in your html templates.
Demonstration
Debug your code!
DEBUG YOUR CODE!
Just F12 / Sources tab in your browser
Or
Debugger for Chrome extension!
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"module": "system",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"allowJs": true
}
}
TSCONFIG.JSON
Map files for live
debugging!
Demonstration
Augury
AUGURY
A Google Chrome Dev Tools extension for debugging
Angular applications.
Install the extension from
Chrome Web Store
24
http://augury.angular.io/
Demonstration
Master the console
CONSOLE
> console.log()
> console.error()
> console.group() / console.groupCollapsed()
> console.groupEnd()
> console.table()
Debug RxJS
DEBUG RXJS
Use the do operator!
getProductById(id: number): Observable<Product> {
return this
.getProducts()
.flatMap(product => product)
.filter(p => p.id == id)
.catch(this.handleError);
}
DEBUG RXJS
Use the do operator!
getProductById(id: number): Observable<Product> {
return this
.getProducts()
.flatMap(product => product)
.filter(p => p.id == id)
.catch(this.handleError);
}
DEBUG RXJS
Use the do operator!
getProductById(id: number): Observable<Product> {
return this
.getProducts()
.do(console.log)
.flatMap(product => product)
.do(console.log)
.filter(p => p.id == id)
.catch(this.handleError);
}
Demonstration
Thank you!
Angular Classroom Training
Debugging an Angular App
submit your evaluation online now to win!
WIN FOR EVALUATION!!

More Related Content

What's hot (20)

PPT
TypeScript Presentation
Patrick John Pacaña
 
PDF
Typescript - MentorMate Academy
Dimitar Danailov
 
PPTX
Typescript ppt
akhilsreyas
 
PPTX
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
PPTX
Typescript in 30mins
Udaya Kumar
 
PDF
TypeScript and Angular workshop
José Manuel García García
 
PDF
Introduction to TypeScript by Winston Levi
Winston Levi
 
PPTX
TypeScript intro
Ats Uiboupin
 
PPTX
TypeScript . the JavaScript developer best friend!
Alessandro Giorgetti
 
PDF
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
PPTX
AngularConf2015
Alessandro Giorgetti
 
PDF
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
PPTX
Typescript 101 introduction
Bob German
 
PDF
Power Leveling your TypeScript
Offirmo
 
PPTX
Typescript overview
Thanvilahari
 
PDF
TypeScript for Java Developers
Yakov Fain
 
PDF
Getting Started with TypeScript
Gil Fink
 
PPTX
Introduction about type script
Binh Quan Duc
 
PPT
Learning typescript
Alexandre Marreiros
 
PDF
TypeScript 2 in action
Alexander Rusakov
 
TypeScript Presentation
Patrick John Pacaña
 
Typescript - MentorMate Academy
Dimitar Danailov
 
Typescript ppt
akhilsreyas
 
Getting started with typescript
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Typescript in 30mins
Udaya Kumar
 
TypeScript and Angular workshop
José Manuel García García
 
Introduction to TypeScript by Winston Levi
Winston Levi
 
TypeScript intro
Ats Uiboupin
 
TypeScript . the JavaScript developer best friend!
Alessandro Giorgetti
 
Typescript for the programmers who like javascript
Andrei Sebastian Cîmpean
 
AngularConf2015
Alessandro Giorgetti
 
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
Typescript 101 introduction
Bob German
 
Power Leveling your TypeScript
Offirmo
 
Typescript overview
Thanvilahari
 
TypeScript for Java Developers
Yakov Fain
 
Getting Started with TypeScript
Gil Fink
 
Introduction about type script
Binh Quan Duc
 
Learning typescript
Alexandre Marreiros
 
TypeScript 2 in action
Alexander Rusakov
 

Similar to Debugging an Angular App (20)

PDF
Introduction to Angular with TypeScript for .NET Developers
Laurent Duveau
 
PDF
Introduction to Angular for .NET Developers
Laurent Duveau
 
PDF
Shit happens… debugging an Angular app.
Laurent Duveau
 
PDF
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Codemotion
 
PPTX
The advantage of developing with TypeScript
Corley S.r.l.
 
PDF
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Codemotion
 
PDF
PVS-Studio: analyzing ReactOS's code
PVS-Studio
 
PDF
Powerful tools for building web solutions
Andrea Tino
 
PDF
The First C# Project Analyzed
PVS-Studio
 
PDF
Looking for Bugs in MonoDevelop
PVS-Studio
 
PDF
Extending JS WU2016 Toronto
Francis Bourre
 
PDF
Maintainable Javascript carsonified
Christian Heilmann
 
PDF
Documenting Bugs in Doxygen
PVS-Studio
 
PPTX
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
PPTX
Ignite your app development with Angular, NativeScript and Firebase
Jen Looper
 
PDF
New Year PVS-Studio 6.00 Release: Scanning Roslyn
PVS-Studio
 
PDF
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Máté Nádasdi
 
PDF
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Todd Anglin
 
PPTX
Rits Brown Bag - TypeScript
Right IT Services
 
PPTX
What's coming to c# (Tel-Aviv, 2018)
Moaid Hathot
 
Introduction to Angular with TypeScript for .NET Developers
Laurent Duveau
 
Introduction to Angular for .NET Developers
Laurent Duveau
 
Shit happens… debugging an Angular app.
Laurent Duveau
 
Erik Wendel - Beyond JavaScript Frameworks: Writing Reliable Web Apps With El...
Codemotion
 
The advantage of developing with TypeScript
Corley S.r.l.
 
Beyond JavaScript Frameworks: Writing Reliable Web Apps With Elm - Erik Wende...
Codemotion
 
PVS-Studio: analyzing ReactOS's code
PVS-Studio
 
Powerful tools for building web solutions
Andrea Tino
 
The First C# Project Analyzed
PVS-Studio
 
Looking for Bugs in MonoDevelop
PVS-Studio
 
Extending JS WU2016 Toronto
Francis Bourre
 
Maintainable Javascript carsonified
Christian Heilmann
 
Documenting Bugs in Doxygen
PVS-Studio
 
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Ignite your app development with Angular, NativeScript and Firebase
Jen Looper
 
New Year PVS-Studio 6.00 Release: Scanning Roslyn
PVS-Studio
 
Ustream vs Legacy, It's never too late to start your fight! #Jsist 2014
Máté Nádasdi
 
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Todd Anglin
 
Rits Brown Bag - TypeScript
Right IT Services
 
What's coming to c# (Tel-Aviv, 2018)
Moaid Hathot
 
Ad

More from Laurent Duveau (20)

PDF
8 things you didn't know about the Angular Router, you won't believe #6!
Laurent Duveau
 
PDF
De 0 à Angular en 1h30! (french)
Laurent Duveau
 
PDF
Angular 6, CLI 6, Material 6 (french)
Laurent Duveau
 
PDF
Angular Advanced Routing
Laurent Duveau
 
PDF
Introduction à Angular 2
Laurent Duveau
 
PDF
Angular 2... so can I use it now??
Laurent Duveau
 
PPTX
ngconf 2016 (french)
Laurent Duveau
 
PDF
Microsoft Edge pour les développeurs web
Laurent Duveau
 
PDF
Microsoft Edge pour les développeurs web
Laurent Duveau
 
PDF
Introduction to SPAs with AngularJS
Laurent Duveau
 
PDF
Xamarin.Forms [french]
Laurent Duveau
 
PDF
Back from Xamarin Evolve 2014
Laurent Duveau
 
PDF
Windows App Studio
Laurent Duveau
 
PDF
Windows 8: Live tiles, badges et notifications toasts [french]
Laurent Duveau
 
PPTX
L'opportunité Windows 8 pour les développeurs
Laurent Duveau
 
PPTX
Building apps for WP8 and Win8
Laurent Duveau
 
PPTX
Windows Store apps development
Laurent Duveau
 
PPTX
L'opportunité Windows 8: Introduction au Windows Store
Laurent Duveau
 
PPTX
Introduction au Windows Store
Laurent Duveau
 
PDF
Windows 8 [french]
Laurent Duveau
 
8 things you didn't know about the Angular Router, you won't believe #6!
Laurent Duveau
 
De 0 à Angular en 1h30! (french)
Laurent Duveau
 
Angular 6, CLI 6, Material 6 (french)
Laurent Duveau
 
Angular Advanced Routing
Laurent Duveau
 
Introduction à Angular 2
Laurent Duveau
 
Angular 2... so can I use it now??
Laurent Duveau
 
ngconf 2016 (french)
Laurent Duveau
 
Microsoft Edge pour les développeurs web
Laurent Duveau
 
Microsoft Edge pour les développeurs web
Laurent Duveau
 
Introduction to SPAs with AngularJS
Laurent Duveau
 
Xamarin.Forms [french]
Laurent Duveau
 
Back from Xamarin Evolve 2014
Laurent Duveau
 
Windows App Studio
Laurent Duveau
 
Windows 8: Live tiles, badges et notifications toasts [french]
Laurent Duveau
 
L'opportunité Windows 8 pour les développeurs
Laurent Duveau
 
Building apps for WP8 and Win8
Laurent Duveau
 
Windows Store apps development
Laurent Duveau
 
L'opportunité Windows 8: Introduction au Windows Store
Laurent Duveau
 
Introduction au Windows Store
Laurent Duveau
 
Windows 8 [french]
Laurent Duveau
 
Ad

Recently uploaded (20)

PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 

Debugging an Angular App