SlideShare a Scribd company logo
1 of 86
How to migrate from
AngularJS
When you can’t use the
word “Big Bang”
?
How is this structured?
• Mental Model
• Plan
• Case Study
How is this structured?
https://github.com/codecraftpro/ang
ularjs-migration-workshop
How is this structured?
Who am I?
Asim Hussain
@jawache
asim@codecraft.tv
Angular:
From Theory to Practice
angular.codecraft.tv
Kickstarter Funded - FREE
angular.codecraft.tv — @jawache
Terminology
angular.codecraft.tv — @jawache
Angular = Angular 4+
angular.codecraft.tv — @jawache
AngularJS = Angular 1.x
angular.codecraft.tv — @jawache
Filters = Pipes
angular.codecraft.tv — @jawache
Controllers = Components
angular.codecraft.tv — @jawache
Directives + HTML = Components
angular.codecraft.tv — @jawache
Directives - HTML = Directives
angular.codecraft.tv — @jawache
Service/Factory = Service
angular.codecraft.tv — @jawache
Entity?
angular.codecraft.tv — @jawache
Angular is BLUE
AngularJS is RED
angular.codecraft.tv — @jawache
DEMO
ui-router
angular.codecraft.tv — @jawache
Mental Model
angular.codecraft.tv — @jawache
Dual Booting
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Resource
Edit
Create
Search
JS
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Resource
Edit
Create
Search
JS
4+
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Resource
Edit
Create
Search
JS
4+
angular.codecraft.tv — @jawache
Zones ➡ $scope.$apply(…)
angular.codecraft.tv — @jawache
Chameleon
angular.codecraft.tv — @jawache
List
List
AngularJS
Downgraded
Angular
Angular
Upgraded
AngularJS
List ⬆
List ⬇
Service ⬇
List
Edit
Service
angular.codecraft.tv — @jawache
Control Freak
angular.codecraft.tv — @jawache
<card>
<body>
<spinner>
<card>
<body>
<spinner>
<card> ⬇
<body>
<spinner>
<body>
<spinner> ⬆
<card> ⬇
Root Component is AngularJS
angular.codecraft.tv — @jawache
Plague
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Edit
Create
Search
JS
4+
Resource ⬇
Service ⬇
List
Card
Spinner
Edit
Create
Search
JS
4+
Resource
Service ⬇
List
Card ⬇
Spinner
Edit
Create
Search
JS
4+
Resource
Service ⬇
List
Card ⬇
Spinner ⬇
Edit
Create
Search
JS
4+
Resource
Service ⬇
List ⬇
Card
Spinner
Edit
Create
Search
JS
4+
Resource
Service
List ⬇
Card
Spinner
Edit ⬇
Create ⬇
Search ⬇
JS
4+
Resource
Service
List
Card
Spinner
Edit
Create
Search
4+
Resource
But…
• Filters
• (some) Directives
10 Step Plan
angular.codecraft.tv — @jawache
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Top Tips!
Start with the Router
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Top Tips!
Start with the Service/Factories
angular.codecraft.tv — @jawache
$resource use $http
angular.codecraft.tv — @jawache
.factory(..) use .service(..)
angular.codecraft.tv — @jawache
$q use Promise
angular.codecraft.tv — @jawache
angular.forEach use for…of
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Resource
Edit
Create
Search
JS
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Resource
Edit
Create
Search
JS
4+
angular.codecraft.tv — @jawache
Top Tips!
Remove ng-app
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Service ⬇
List
Card
Spinner
Edit
Create
Search
JS
4+
Resource
angular.codecraft.tv — @jawache
Top Tips!
• Re-write
• Find
• Upgrade
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Service ⬇
List
Card ⬇
Spinner ⬇
Edit
Create
Search
JS
4+
Resource
angular.codecraft.tv — @jawache
Service ⬇
List ⬇
Card
Spinner
Edit
Create
Search
JS
4+
Resource
angular.codecraft.tv — @jawache
Service ⬇
List ⬇
Card
Spinner
Edit ⬇
Create
Search
JS
4+
Resource
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual Boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Tiny Pop
• Bootstrap with Angular
• Angular Router
angular.codecraft.tv — @jawache
CODE!
1. Style guide
2. TypeScript & build tools
3. AngularJS 1.5+
4. Component’ify
5. ES6’ify
6. Dual boot
7. Services to Angular
8. Components to Angular
9. Routing to Angular
10.Remove AngularJS
angular.codecraft.tv — @jawache
Service
List
Card
Spinner
Edit
Create
Search
4+
Resource
angular.codecraft.tv — @jawache
Finished
Questions?
asim@codecraft.tv
@jawache
github.com/jawache/ama

More Related Content

What's hot

The Evolution Of JavaScript
The Evolution Of JavaScriptThe Evolution Of JavaScript
The Evolution Of JavaScriptMostafa Zaki
 
Painting a Vision for Your Product
Painting a Vision for Your ProductPainting a Vision for Your Product
Painting a Vision for Your ProductAtlassian
 
Mean full stack development
Mean full stack developmentMean full stack development
Mean full stack developmentScott Lee
 
Introducción a DevOps workshop
Introducción a DevOps workshopIntroducción a DevOps workshop
Introducción a DevOps workshopMarco Avendaño
 
Salesforce DevOps using GitHub Action
Salesforce DevOps using GitHub ActionSalesforce DevOps using GitHub Action
Salesforce DevOps using GitHub ActionSakthivel Madesh
 
Customer Journey Map Template
Customer Journey Map TemplateCustomer Journey Map Template
Customer Journey Map TemplateOpsPanda
 
Mobile Application Development Services
Mobile Application Development ServicesMobile Application Development Services
Mobile Application Development ServicesTaction Software LLC
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptWojciech Dzikowski
 
What is dotnet (.NET) ?
What is dotnet (.NET) ?What is dotnet (.NET) ?
What is dotnet (.NET) ?Talha Shahzad
 
A New Introduction to Jira & Agile Product Management
A New Introduction to Jira & Agile Product ManagementA New Introduction to Jira & Agile Product Management
A New Introduction to Jira & Agile Product ManagementDan Chuparkoff
 
Git workflow step by step
Git workflow step by stepGit workflow step by step
Git workflow step by stepBinh Quan Duc
 
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...Odoo
 
Unit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitUnit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitJeremy Cook
 
WhichBus Pitch Deck
WhichBus Pitch DeckWhichBus Pitch Deck
WhichBus Pitch DeckWhichBus
 
UX STRAT USA 2018 Presentation: Heidi Munc, Nationwide
UX STRAT USA 2018 Presentation: Heidi Munc, NationwideUX STRAT USA 2018 Presentation: Heidi Munc, Nationwide
UX STRAT USA 2018 Presentation: Heidi Munc, NationwideUX STRAT
 
How Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivityHow Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivityIvan Porta
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architectureDaniele D'Angeli
 

What's hot (20)

The Evolution Of JavaScript
The Evolution Of JavaScriptThe Evolution Of JavaScript
The Evolution Of JavaScript
 
Painting a Vision for Your Product
Painting a Vision for Your ProductPainting a Vision for Your Product
Painting a Vision for Your Product
 
Mean full stack development
Mean full stack developmentMean full stack development
Mean full stack development
 
React Hooks
React HooksReact Hooks
React Hooks
 
Angular vs React vs Vue
Angular vs React vs VueAngular vs React vs Vue
Angular vs React vs Vue
 
Introducción a DevOps workshop
Introducción a DevOps workshopIntroducción a DevOps workshop
Introducción a DevOps workshop
 
Salesforce DevOps using GitHub Action
Salesforce DevOps using GitHub ActionSalesforce DevOps using GitHub Action
Salesforce DevOps using GitHub Action
 
Customer Journey Map Template
Customer Journey Map TemplateCustomer Journey Map Template
Customer Journey Map Template
 
Mobile Application Development Services
Mobile Application Development ServicesMobile Application Development Services
Mobile Application Development Services
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
 
What is dotnet (.NET) ?
What is dotnet (.NET) ?What is dotnet (.NET) ?
What is dotnet (.NET) ?
 
A New Introduction to Jira & Agile Product Management
A New Introduction to Jira & Agile Product ManagementA New Introduction to Jira & Agile Product Management
A New Introduction to Jira & Agile Product Management
 
Git workflow step by step
Git workflow step by stepGit workflow step by step
Git workflow step by step
 
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
E-commerce: the new Magento - OpenERP Connector: a generic connector to any a...
 
Unit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnitUnit test your java architecture with ArchUnit
Unit test your java architecture with ArchUnit
 
WhichBus Pitch Deck
WhichBus Pitch DeckWhichBus Pitch Deck
WhichBus Pitch Deck
 
UX STRAT USA 2018 Presentation: Heidi Munc, Nationwide
UX STRAT USA 2018 Presentation: Heidi Munc, NationwideUX STRAT USA 2018 Presentation: Heidi Munc, Nationwide
UX STRAT USA 2018 Presentation: Heidi Munc, Nationwide
 
How Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivityHow Azure DevOps can boost your organization's productivity
How Azure DevOps can boost your organization's productivity
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
 
Sug bangalore - headless jss
Sug bangalore - headless jssSug bangalore - headless jss
Sug bangalore - headless jss
 

Similar to Migrating from AngularJS when you can't use the word "Big Bang@

Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Asim Hussain
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practicesHenry Tao
 
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 MinutesUsing Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 MinutesTracy Lee
 
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017Matt Raible
 
Platform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch EventPlatform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch EventFokke Zandbergen
 
Angular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfAngular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfKaty Slemon
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017Matt Raible
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy AppsPeter Drinnan
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project ReportKodexhub
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSYuriy Silvestrov
 
An introduction to AngularJS
An introduction to AngularJSAn introduction to AngularJS
An introduction to AngularJSYogesh singh
 
From AngularJS to React: why migration is a must
From AngularJS to React: why migration is a mustFrom AngularJS to React: why migration is a must
From AngularJS to React: why migration is a mustAdam Kosmala
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Matt Raible
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...Gavin Pickin
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Onely
 
KnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCKnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCLearnNowOnline
 

Similar to Migrating from AngularJS when you can't use the word "Big Bang@ (20)

Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+Migrating From Angular 1.x to Angular 2+
Migrating From Angular 1.x to Angular 2+
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practices
 
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 MinutesUsing Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
 
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
The Ultimate Getting Started with Angular Workshop - Devoxx UK 2017
 
Platform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch EventPlatform 4.0 Meetup Launch Event
Platform 4.0 Meetup Launch Event
 
Angular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdfAngular Universal How to Build Angular SEO Friendly App.pdf
Angular Universal How to Build Angular SEO Friendly App.pdf
 
Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
The Ultimate Getting Started with Angular Workshop - Devoxx France 2017
 
AngularJS for Legacy Apps
AngularJS for Legacy AppsAngularJS for Legacy Apps
AngularJS for Legacy Apps
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
JS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJSJS FAST Prototyping with AngularJS & RequireJS
JS FAST Prototyping with AngularJS & RequireJS
 
Mkp resume.docx
Mkp resume.docxMkp resume.docx
Mkp resume.docx
 
An introduction to AngularJS
An introduction to AngularJSAn introduction to AngularJS
An introduction to AngularJS
 
From AngularJS to React: why migration is a must
From AngularJS to React: why migration is a mustFrom AngularJS to React: why migration is a must
From AngularJS to React: why migration is a must
 
Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017Front End Development for Back End Developers - vJUG24 2017
Front End Development for Back End Developers - vJUG24 2017
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
 
KnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVCKnockOutJS with ASP.NET MVC
KnockOutJS with ASP.NET MVC
 
AngularJS 101
AngularJS 101AngularJS 101
AngularJS 101
 

Recently uploaded

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Migrating from AngularJS when you can't use the word "Big Bang@

Editor's Notes

  1. Welcome to this workshop on how to migrate from Angular 1
  2. As anyone who's done a large upgrade before knows. - SHOW GIF - It’s always a lot more complex and risky than you thought at first.
  3. But don’t worry. What i’m going to be teaching you here is a technique that I used with my larger clients. Those who really can’t use the word “big bang”. Production app, lots of traffic. Regulatory issues. Can’t afford a down tools, upgrade and re-write whats broken approach. Where nothing is released until the entire upgrade is complete. I’m going to cover a technique thats iterative step by step approach - at each stage you have a releasable product. Can’t afford for developers to stop, tools down and develop.
  4. [Q] Who here are in the process of migrating an AngularJS app or plan to do so in the next 3 months? [Q] Of those how many of you have an SPA? [Q] Of those how many of you are using UI-Router? BIG BIG BIG CAVEAT SPA More focussed on happy path than Joes workshop. You are actively looking to migrate.
  5. How is this structured? First the theory behind what we are doing, the mental model. This is going to be messy work. But underlying it all is a simple structure and a clear set of rules. If you’ve got a good grasp of those you can see through the mess to the other side. Then i’ll describe the plan, something pretty generic that you can apply to your projects. Then we’ll dive in with a real case study. Now this is a workshop that I do that takes a whole day, so we can’t cover all it in the hour. - I am going to cover the highlights. I am going to show you snippets of code but i’m not going to write any, there just isn’t time and too much to get through.
  6. Can find all the source code here. PAUSE FOR 10 SECONDS I’m not going to cover everything and I don’t expect you to remember everything. But if you want to really understand what i’m doing then after this workshop you need to take a deep look at this project on github, everything is explained in much more depth in there. [GOTO PAGE] Show branches and pull request and instructions for installing.
  7. My name is Asim, I run codecraft.tv where I do consulting and training on Angular and JS. Recently consulting has been with enterprise customers or those dealing with complex legacy projects that they need to drag into the new age.
  8. My name is Asim, I run codecraft.tv where I do consulting and training on Angular and JS. Recently consulting has been with enterprise customers or those dealing with complex legacy projects that they need to drag into the new age.
  9. I recently released a book on Angular 2 called Angular 2: From Theory to Practice It was funded through some very generous backers on Kickstarter so it’s actually been released for free :) You can find it on Amazon, iBooks, all the major online ebook stores. Still for FREE You can also get it from my site at angular.codecraft.tv which gets updated first and also has a bunch of videos that you can watch.
  10. First a word mapping!
  11. Demo the contacts application
  12. Demo the contacts application
  13. Demo the contacts application
  14. Demo the contacts application
  15. Demo the contacts application
  16. Demo the contacts application
  17. Demo the contacts application
  18. When i mention an entity, i mean a component, service, filter, pipe, controller… a single thing in the app.
  19. I’m going to show lots of slides with entities that are AngularJS and others that are Angular Both are kinda red coloures. To help people with color blindness i’ve changed
  20. STEP DEMO Demo Contacts App Describe the different entities
  21. We are gonna play a little quizz. Can you guess the mental model from the picture?
  22. Who can guess what this is?
  23. [WALK AND TALK] This is a simplified view of our app Some top level directives/controllers which consume other directives/controllers and perhaps some services
  24. While migrating we run both Angular 1 and Angular 4 in the same application! We call this a Hybrid application. So yeah, during the process of migration your users will have to download both but that’s the price you’ll have to pay.
  25. Notice the EDIT and SERVICE (they have animations) In a hybrid application some entities can be written in Angular 2 and some in Angular 1. They work together and the application still runs.
  26. [Q] Who is pretty comfortable with their knowledge of Zones? The new application is running in Angular 2+ zone, and therefore it no longer needs calls to $apply().
  27. The second mental model is that it’s chameleon.
  28. We have a 1 entity and a 2 entity. They don’t see each other. So what we can do is we can upgrade 1 downgrade 2 Now an upgraded 1 can be used in an 2 entity or a 1 entity or even an upgraded 2 entity. [WALK AND TALK] Same goes for a downgraded Angular entity
  29. [WALK AND TALK] DI also still works. We can have a downgraded Angular 2 service that’s injected into a 2 or 1 entity. It’s also the same instance, so any data you set will be visible from the other entity
  30. The final mental model
  31. Each HTML node can only belong to either AngularJS or Angular 4 Example above the nodes are all controlled by AngularJS Our goal therefore is to slowly transform all the entities to Angular 4. You can go at this whichever direction you want.
  32. An Angular 1 component is managed by Angular 1 and only knows Angular 1. So if we tried to insert an Angular 2 entity into an Angular 1 entity It wouldn’t blow up, the Angular 1 component just doesn’t know what card is so ignores it.
  33. Downgrade it. Wrapped in Angular 1 clothing Still an Angular 2 component Therefore it doesn’t see the Spinner control Just like before that gets ignored!
  34. So what we do is upgrade the spinner control We wrap it in Angular 2 clothes so it can be recognised by Angular 2 components.
  35. Angular 1 is always bootstrapped first and owns the bottom most view.
  36. Think of the process of migration like a disease.
  37. We infect an entity with Angular 4 . I recommend you stat at the leaves. Downgrade
  38. Then we slowly spread up the app. NOTICE we only need to downgrade the component that is being used by a 1 entity.
  39. Then we spread up.
  40. And up
  41. And UP
  42. Until eventually we’ve spread everywhere…
  43. And then we get rid of 1
  44. So everything is not all rosy
  45. Not everything in Angular 1 can be migrated to Angular 2 Some things have to be re-written Filters can’t be migrated. Directives w/out templates and other features will need to be re-written.
  46. What do I mean by a component? Introduced in Angular 1.5 They are like a simplified and restricted version of a directive. They are also a core part of Angular 4. So moving to components now will make moving to Angular components in the future much easier. Flip between step 1 and step 5 SHOW: ui-router config SHOW: controller -> component config SHOW: directives -> component NOTE: Show $ctrl as syntax
  47. Start with the router since those are typically the top level nodes in your application, you don’t have to but I find it’s a good place to start.
  48. DEMO Branch: Step 4 Show code for person list component: CONTROLLER -> COMPONENT Show how you use these in the router config.
  49. Converted all. STILL RUNNING ANGULAR 1 Have some fun! - Lets now start having some fun, es6’ify your app (or typescriptifying depending on how far you take it). Use ES6 contstructs, classes, learn destructing, fat arrow syntax etc..
  50. A great place to start is the services. Angular 1 services written as ES6 classes are very easy to migrate to Angular 4.
  51. There is no $resource in Angular 2 There is the Http module which looks very much like the Angular 1 $http module. So spend this time to migrate away from $resource to $http.
  52. Since ES6 classes are just constructor functions. And services in Angular 1 are also just constructor functions and also map to Angular 2 services much better. Spend this time to also move from using factory to service.
  53. There is no $q in Angular 2 So maybe spend this time re-writing to use the new ES6 Promise syntax.
  54. STEP 5 SHOW: Contact Resource - Use class and $http, constructor SHOW: Contact Service - Use class, promises etc…
  55. Now we’ve done all the prep work we are ready for the actual migrate. We just include Angular 4 Create our main AppModule and then instead of bootstrapping that directly we duel boot with both Angular 1 and Angular 2.
  56. All we are doing is adding Angular to our application.
  57. We are now here. A duel booted Angular 1 + 2 application, but all of the components/directives/services are all still Angular 1.
  58. A great place to start is the services. Angular 1 services written as ES6 classes are very easy to migrate to Angular 2.
  59. STEP-6 Add packages to package.json Add main.ts and bootstrap
  60. It’s far easier in my opinion to just go bottom up. Convert the leaves to Angular 2 and then move up the tree. Services are going to be shared by lots of different things in our app so it makes sense to migrate those to Angular 2 first. Thankfully due to our prep it’s going to be pretty easy.
  61. Going back to our diagram we’ve got two services, ContactService ContactResource Going to migrate ContactService to Angular 2 and then downgrade it so it can be used in Angular 1 and since Resource is only going to be used by an Angular 2 service we migrate it to Angular 2 and don’t need to downgrade it.
  62. When faced with a 3rd party Angular 1 service You don’t control it. You can’t migrate it. So what do you do? Re-write to Angular 2+ yourself Find an Angular 2+ version Upgrade to Angular 2+
  63. STEP-7 ContactService NOTICE: @Injectable() NgModule downgradeInjectable We still have our angular 1 module config at the bottom, but we add to our Angular 1 config a downgraded version of this service. This is what makes our ContactService usable from both an Angular 1 and an Angular 2 entity. Toaster It’s not in the diagram to save space but the ContactService also relies on a 3rd party Angular 1 service called toaster? We don’t control toaster, we can migrate it - so how do we make it injectable into an Angular 2 service? We can try to write our own? We can try to find if there is a 3rd party Angular 2 version? We can upgrade an angular 1 service to use in an Angular 2 app. Eventually we’ll have to figure out a solution, we can’t drop Angular 1 till we figure out a solution but for now we can use upgrade. We can Upgrade an Angular 1 service to make it available in Angular 2 entity. ajs-upgraded-providers.ts Copy paste code.
  64. We are getting close people!
  65. Again start at the leaves. In this case study i started at the card and spinner components. Very similar to the services method we just migrate them to Angular 2 and then downgrade so they can be used in Angular 1.
  66. Then it’s just the grind, slowly walking up the tree. Migrating them to Angular 2 and the downgrading them to be used in Angular 1. Most of the issues you’ll face are just about dependancies that you can’t control. Re-write Find Upgrade Most of the time you’ll want to opt for the second two, since the goal is to get rid of Angular 1.
  67. STEP-8 person-list.component @Component Template, show how you now use Angular 2 syntax since it’s an Angular 2 component. downguadecomponent spinner Same problem as the toaster. Upgrade Rewrite Look for another 3rd party module. card.component Bindings -> Inputs Need to use Ladda buttons - we’ve upgraded to an Angular 2 version. Need to use ui-router links, hard code them. No need to downgrade since we are only using this in Angular components now. person-create.component externalised the template code UI Router Services, upgraded them. search.component (can skip) [Q] Who uses ng-model-options? In Angular 2 the way to solve this problem is via model forms and Observables. This time i went for a re-write, not the best but essentially using the same underlying library called spin.js to load the spinner. Won’t go into depth you can look at the code and compare the branches yourself to see the changes.
  68. Ok so we are there now
  69. I can’t figure out how to easily break this up into small steps, so I call this the tiny pop. NOT big bang.
  70. Stop Hybrid mode. Swap out ui-router <> Angular 2 Router
  71. STEP-9 Angular Booting Add app component Remove duel boot code Replace app-root in index.html DROP UPGRADED SERVICES Ignore UIRouter Upgrade Toaster Router Add base-href App Routes Replace UIServices Replace $state.go
  72. Find solutions to all the upgraded Angular 1 entities that you used. For my demo app it’s actually the Toaster which we upgraded, in the end I found an Angular 2 one on the internet. Basically remove all the old code. Make sure you remove all the code referring to Angular 1 otherwise your build tools might pull that code it and bundle it with yours. Now you are running a fun Angular 2 application! Remove AngularJS which means Replacing remove final set of upgraded ng1 services/components (toaster)