SlideShare a Scribd company logo
Your Cloud.
Your Business.
Advanced Angular Tips and Tricks
Jeremy Likness
Principal Architect
@JeremyLikness
www.ivision.com
TODAY’S AGENDA
1. Background Where did these tips and tricks come from?
2. Integration Tips for integrating existing JavaScript code
3. Best Practices Lessons learned in the trenches
4. Debugging Debugging Angular apps
5. Performance Writing Angular apps that scale and perform well
BACKGROUND
BACKGROUND
• Several Enterprise AngularJS Projects
• Largest Project:
• 80,000+ lines of TypeScript code (generated JavaScript even bigger)
• 100s of controllers, services, filters, and directives
• Global team of 25+ developers
• 2 years of development before go-live
• Exceeded client expectations for performance in most areas
• How much content have you read began with “I was tinkering
with…” or “I was exploring…”?
Lessons Learned
• It’s important you pick a code structure. There is no “best one” but it is
important to have one. We did:
/controllers
../common
../products
../customers
/directives
../common
../products
• Decouple from $scope as fast as you can!
• Don’t rely on $scope hierarchy/inheritance
• Use services for communication
• Use controller as syntax
• Maxim of Least Angular
• Test Early, and Test Often!
• For large teams, consider TypeScript
DEMO: Lessons Learned
INTEGRATION
INTEGRATION
• Register and reuse third-party components with Angular’s
dependency injection system
• Wrap third-party components to trigger digest
• Extend third-party components to be “Angular aware”
• Wrap third-party controls with Angular directives
• Create reusable libraries with Angular modules
• Consume third-party modules with Angular
DEMO: Integration
BEST PRACTICES
BEST PRACTICES
• $scope (addressed earlier)
• Use values (or constants) where it makes sense
• Wrap APIs in services and understand interceptors
• Use $log and $exceptionHandler
• Apply behaviors by decorating existing services with $provide
• Define code using Angular’s extend
• Lazy-load components with the injector when they aren’t
commonly used
• Use route’s “resolve” to guarantee asynchronous context
DEMO: Best Practices
DEBUGGING
DEBUGGING
• All major browsers provide F12 “debug tools”
• In Chrome, you can inspect/select an element and reference it as $0
• angular.element(x) wraps a DOM element as a node with Angular
functions e.g. angular.element($0)
• scope()
• isolateScope()
• controller()
• injector()
• Expand objects then navigate to source and set breakpoints/watches
• Batarang
DEMO: Debugging
PERFORMANCE
PERFORMANCE
• Batarang
• Zone to instrument
• Bindonce or new :: prefix
• Double-list approach
• ng-if vs. ng-show
• Measure twice, cut once!
DEMO: Performance
Questions?
Source for this deck
https://github.com/JeremyLikness/AngularTipsAndTricks
Running example for this deck
http://jeremylikness.github.io/AngularTipsAndTricks/
Mastering AngularJS Course: fundamentals, scope, digest, filters, dependency injection,
services, web services, routes, directives, testing, debugging and performance
https://www.wintellectnow.com/course/detail/mastering-angularjs
Jeremy Likness, Principal Architect @JeremyLikness

More Related Content

What's hot (20)

Unit testing
Unit testingUnit testing
Unit testing
Leonardo Balter
 
Building great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapiBuilding great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapi
Maurice De Beijer [MVP]
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
 
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
 
Why Everyone else writes bad code
Why Everyone else writes bad codeWhy Everyone else writes bad code
Why Everyone else writes bad code
ColdFusionConference
 
Demand driven applications with om.next and react native
Demand driven applications with om.next and react nativeDemand driven applications with om.next and react native
Demand driven applications with om.next and react native
dvcrn
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
Jesse Warden
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
How to build a JavaScript toolkit
How to build a JavaScript toolkitHow to build a JavaScript toolkit
How to build a JavaScript toolkit
Michael Nelson
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovDevelop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
Ankit Kashyap
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sirwan Afifi
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
Foyzul Karim
 
Frontend as a first class citizen
Frontend as a first class citizenFrontend as a first class citizen
Frontend as a first class citizen
Marcin Grzywaczewski
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
justvamp
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
Igor Talevski
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013
Danijel Malik
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
Anand Bagmar
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
Omkarsoft Bangalore
 
Building great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapiBuilding great spa’s with angular js, asp.net mvc and webapi
Building great spa’s with angular js, asp.net mvc and webapi
Maurice De Beijer [MVP]
 
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and BackboneJavascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Javascript Frameworks Comparison - Angular, Knockout, Ember and Backbone
Deepu S Nath
 
Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017Latest Javascript MVC & Front End Frameworks 2017
Latest Javascript MVC & Front End Frameworks 2017
AmarInfotech
 
Demand driven applications with om.next and react native
Demand driven applications with om.next and react nativeDemand driven applications with om.next and react native
Demand driven applications with om.next and react native
dvcrn
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
Jesse Warden
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
Kasun Kodagoda
 
How to build a JavaScript toolkit
How to build a JavaScript toolkitHow to build a JavaScript toolkit
How to build a JavaScript toolkit
Michael Nelson
 
Develop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val KarpovDevelop a Basic REST API from Scratch Using TDD with Val Karpov
Develop a Basic REST API from Scratch Using TDD with Val Karpov
MongoDB
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
Ankit Kashyap
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sirwan Afifi
 
Angular4 kickstart
Angular4 kickstartAngular4 kickstart
Angular4 kickstart
Foyzul Karim
 
AngularJS + React
AngularJS + ReactAngularJS + React
AngularJS + React
justvamp
 
Mvvm knockout vs angular
Mvvm knockout vs angularMvvm knockout vs angular
Mvvm knockout vs angular
Basarat Syed
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
Igor Talevski
 
What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013What's new in Visual Studio 2013 & TFS 2013
What's new in Visual Studio 2013 & TFS 2013
Danijel Malik
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
Anand Bagmar
 

Viewers also liked (8)

Enterprise TypeScript
Enterprise TypeScriptEnterprise TypeScript
Enterprise TypeScript
Jeremy Likness
 
Windows 8.1 Sockets
Windows 8.1 SocketsWindows 8.1 Sockets
Windows 8.1 Sockets
Jeremy Likness
 
My XML is Alive! An Intro to XAML
My XML is Alive! An Intro to XAMLMy XML is Alive! An Intro to XAML
My XML is Alive! An Intro to XAML
Jeremy Likness
 
The Windows Runtime and the Web
The Windows Runtime and the WebThe Windows Runtime and the Web
The Windows Runtime and the Web
Jeremy Likness
 
Cross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team ServicesCross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team Services
Jeremy Likness
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1
David Amend
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
My XML is Alive! An Intro to XAML
My XML is Alive! An Intro to XAMLMy XML is Alive! An Intro to XAML
My XML is Alive! An Intro to XAML
Jeremy Likness
 
The Windows Runtime and the Web
The Windows Runtime and the WebThe Windows Runtime and the Web
The Windows Runtime and the Web
Jeremy Likness
 
Cross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team ServicesCross-Platform Agile DevOps with Visual Studio Team Services
Cross-Platform Agile DevOps with Visual Studio Team Services
Jeremy Likness
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 
Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1Angular 2 : learn TypeScript already with Angular 1
Angular 2 : learn TypeScript already with Angular 1
David Amend
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Ad

Similar to Advanced AngularJS Tips and Tricks (20)

Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Eugene Fidelin
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjs
WebF
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
AngularJS Curriculum-Zeolearn
AngularJS Curriculum-ZeolearnAngularJS Curriculum-Zeolearn
AngularJS Curriculum-Zeolearn
Hamdi Ceylan
 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise application
vu van quyet
 
Building modular enterprise scale angular js applications
Building modular enterprise scale angular js applicationsBuilding modular enterprise scale angular js applications
Building modular enterprise scale angular js applications
Jonathan Fontanez
 
Bhuvi ppt zerobug
Bhuvi ppt zerobugBhuvi ppt zerobug
Bhuvi ppt zerobug
BhuviS3
 
angular javascript interview questions with talent titan.pptx
angular javascript interview questions with talent titan.pptxangular javascript interview questions with talent titan.pptx
angular javascript interview questions with talent titan.pptx
nathvansh89
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
Albiorix Technology
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
Gaurav Singh
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
vitaragaistechnolabs
 
Mastering Angular: A Comprehensive Guide
Mastering Angular: A Comprehensive GuideMastering Angular: A Comprehensive Guide
Mastering Angular: A Comprehensive Guide
Jay Verma
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
Rolands Krumbergs
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
murtazahaveliwala
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
Alex Ross
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjs
WebF
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
AngularJS Curriculum-Zeolearn
AngularJS Curriculum-ZeolearnAngularJS Curriculum-Zeolearn
AngularJS Curriculum-Zeolearn
Hamdi Ceylan
 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise application
vu van quyet
 
Building modular enterprise scale angular js applications
Building modular enterprise scale angular js applicationsBuilding modular enterprise scale angular js applications
Building modular enterprise scale angular js applications
Jonathan Fontanez
 
Bhuvi ppt zerobug
Bhuvi ppt zerobugBhuvi ppt zerobug
Bhuvi ppt zerobug
BhuviS3
 
angular javascript interview questions with talent titan.pptx
angular javascript interview questions with talent titan.pptxangular javascript interview questions with talent titan.pptx
angular javascript interview questions with talent titan.pptx
nathvansh89
 
Angular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web ApplicationsAngular Best Practices To Build Clean and Performant Web Applications
Angular Best Practices To Build Clean and Performant Web Applications
Albiorix Technology
 
Mastering angular - Dot Net Tricks
Mastering angular - Dot Net TricksMastering angular - Dot Net Tricks
Mastering angular - Dot Net Tricks
Gaurav Singh
 
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
[Ebooks PDF] download AngularJS 1st Edition Brad Green full chapters
kiciunonge
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
Who Benefits More from the Expertise of AngularJS Developers vs. Traditional ...
vitaragaistechnolabs
 
Mastering Angular: A Comprehensive Guide
Mastering Angular: A Comprehensive GuideMastering Angular: A Comprehensive Guide
Mastering Angular: A Comprehensive Guide
Jay Verma
 
Building scalable applications with angular js
Building scalable applications with angular jsBuilding scalable applications with angular js
Building scalable applications with angular js
Andrew Alpert
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
murtazahaveliwala
 
AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)AngularJS in Production (CTO Forum)
AngularJS in Production (CTO Forum)
Alex Ross
 
Ad

Recently uploaded (20)

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.pdfLooking 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
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage OverlookCode and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Transmission Media. (Computer Networks)
Transmission Media.  (Computer Networks)Transmission Media.  (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Making significant Software Architecture decisions
Making significant Software Architecture decisionsMaking significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AIReimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutionsZoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
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.pdfLooking 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
 
dp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdfdp-700 exam questions sample docume .pdf
dp-700 exam questions sample docume .pdf
pravkumarbiz
 
Who will create the languages of the future?
Who will create the languages of the future?Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage OverlookCode and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Async-ronizing Success at Wix - Patterns for Seamless Microservices - Devoxx ...
Natan Silnitsky
 
Transmission Media. (Computer Networks)
Transmission Media.  (Computer Networks)Transmission Media.  (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Making significant Software Architecture decisions
Making significant Software Architecture decisionsMaking significant Software Architecture decisions
Making significant Software Architecture decisions
Bert Jan Schrijver
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AIReimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutionsZoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Integrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FMEIntegrating Survey123 and R&H Data Using FME
Integrating Survey123 and R&H Data Using FME
Safe Software
 
Agile Software Engineering Methodologies
Agile Software Engineering MethodologiesAgile Software Engineering Methodologies
Agile Software Engineering Methodologies
Gaurav Sharma
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines OperationsHow Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 

Advanced AngularJS Tips and Tricks

  • 1. Your Cloud. Your Business. Advanced Angular Tips and Tricks Jeremy Likness Principal Architect @JeremyLikness
  • 3. TODAY’S AGENDA 1. Background Where did these tips and tricks come from? 2. Integration Tips for integrating existing JavaScript code 3. Best Practices Lessons learned in the trenches 4. Debugging Debugging Angular apps 5. Performance Writing Angular apps that scale and perform well
  • 5. BACKGROUND • Several Enterprise AngularJS Projects • Largest Project: • 80,000+ lines of TypeScript code (generated JavaScript even bigger) • 100s of controllers, services, filters, and directives • Global team of 25+ developers • 2 years of development before go-live • Exceeded client expectations for performance in most areas • How much content have you read began with “I was tinkering with…” or “I was exploring…”?
  • 6. Lessons Learned • It’s important you pick a code structure. There is no “best one” but it is important to have one. We did: /controllers ../common ../products ../customers /directives ../common ../products • Decouple from $scope as fast as you can! • Don’t rely on $scope hierarchy/inheritance • Use services for communication • Use controller as syntax • Maxim of Least Angular • Test Early, and Test Often! • For large teams, consider TypeScript
  • 9. INTEGRATION • Register and reuse third-party components with Angular’s dependency injection system • Wrap third-party components to trigger digest • Extend third-party components to be “Angular aware” • Wrap third-party controls with Angular directives • Create reusable libraries with Angular modules • Consume third-party modules with Angular
  • 12. BEST PRACTICES • $scope (addressed earlier) • Use values (or constants) where it makes sense • Wrap APIs in services and understand interceptors • Use $log and $exceptionHandler • Apply behaviors by decorating existing services with $provide • Define code using Angular’s extend • Lazy-load components with the injector when they aren’t commonly used • Use route’s “resolve” to guarantee asynchronous context
  • 15. DEBUGGING • All major browsers provide F12 “debug tools” • In Chrome, you can inspect/select an element and reference it as $0 • angular.element(x) wraps a DOM element as a node with Angular functions e.g. angular.element($0) • scope() • isolateScope() • controller() • injector() • Expand objects then navigate to source and set breakpoints/watches • Batarang
  • 18. PERFORMANCE • Batarang • Zone to instrument • Bindonce or new :: prefix • Double-list approach • ng-if vs. ng-show • Measure twice, cut once!
  • 20. Questions? Source for this deck https://github.com/JeremyLikness/AngularTipsAndTricks Running example for this deck http://jeremylikness.github.io/AngularTipsAndTricks/ Mastering AngularJS Course: fundamentals, scope, digest, filters, dependency injection, services, web services, routes, directives, testing, debugging and performance https://www.wintellectnow.com/course/detail/mastering-angularjs Jeremy Likness, Principal Architect @JeremyLikness