SlideShare a Scribd company logo
Moving From AngularJS to
Angular 2
By Ahamed Imran
@immysl
“AngularJS is a framework.
Angular 2 is a platform”
- Brad Green -
Why Angular 2?
• Cross platform
• Very good performance
• Good tooling support (IDEs and CLI tool)
• Ecosystem — RxJS, TypeScript, NativeScript, etc.
• Very good mobile support
“The value in TypeScript is in
writing safer code”
- John Papa -
Why TypeScript?
• Check for errors at compile time
• Good tooling support
• Is a mix of types, ES2015 and ESNext
• The fastest growing superset of JavaScript
• Compatibility with non-TypeScript libraries
What has changed?
• There are components — No controllers
• There are services — No providers and factories
• There are zones — No $scope
• There are APIs for DOM manipulation — No jqLite
• One way data flow — No two way data flow
Angular 2 Concepts
• Components
• Dependency Injection
• Data Binding
• Metadata / decorators
• Modules
Components
• Inputs
• Outputs / events
• Lifecycle
• Providers
• Template
Components Example
@Component({
selector: 'my-component',
providers: [MyService],
template: ‘<p *ngFor=”let item of list” (click)=”sendUpdate()”>{{ item }}</p>’,
styles: [‘p { font-size: 14px }’]
})
class MyComponent implements OnInit {
@Input() list;
@Output() update = new EventEmitter();
ngOnInit() { } // get async data
sendUpdate() { this.update.emit(‘some value’) }
}
Dependency Injection Example
@Component({
...
providers: [MyService]
})
export class MyComponent {
constructor(private service: MyService) {} // inject here
ngOnInit() {
service.getList(); // this is just a dummy line
}
}
Data Binding
• Interpolation
• Property binding (inputs)
• Event binding (outputs)
• Two-way binding
// example
<my-component [title]=”list” (update)=”getUpdate($event)”></my-component>
Metadata / Decorators
@Component({
selector: '...',
template: ‘<h2>{{title}}</h2>’
})
// common decorators
@Input()
@Output()
@Pipe()
@Injectable()
Modules
• Brand new — released yesterday
• Somewhat similar to AngularJS module
• An app needs to have a root module
• Separate modules based on features
• Not same as JavaScript / TypeScript modules
Modules Example
import { NgModule } from ‘@angular/core’;
import { BrowserModule } from ‘@angular/platform-browser’;
Import { MyComponent } from ‘./my.component’;
@NgModule({
imports: [BrowserModule],
providers: [MyService],
declarations: [MyComponent, MyDirective, MyPipe],
bootstrap: [AppComponent]
})
export class AppModule { }
Angular Libraries
• Router
• Form
• Upgrade
• Compiler
• Compiler-cli
Angular CLI
• Official scaffolding and build tool for Angular 2
• Maintained by the Angular team
• Latest uses Webpack for build and server
• Currently as a command-line tool only
Other Tools
• Codelyzer — style guide checker
• Augury — Angular 2 debugger as a Chrome extension
• Lite-server — A live reload server for Angular
Demo
Norway
+47 959 23 712
oslo@exilesoft.com
Stortorvet 10
0155 Oslo
Norway
Sweden
+46 735 194 442
stockholm@exilesoft.com
Stockholmsvägen 33
181 33 Lidingö
Sweden
Australia
+61 412 446 105
sydney@exilesoft.com
Suite2.14, 32 Delhi Road
North Ryde, NSW 2113
Australia
Sri Lanka
+94 112 300 900
colombo@exilesoft.com
201, Sir James Peiris Mw.
Colombo 02
Sri Lanka
www.exilesoft.com

More Related Content

What's hot

Introducing angular
Introducing angularIntroducing angular
Introducing angular
Columbia Developers Guild
 
React vs-angular-mobile
React vs-angular-mobileReact vs-angular-mobile
React vs-angular-mobile
Michael Haberman
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to react
kiranabburi
 
React introduction
React introductionReact introduction
React introduction
Kashyap Parmar
 
Marrying angular rails
Marrying angular railsMarrying angular rails
Marrying angular rails
Volker Tietz
 
2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro
PHP Conference Argentina
 
Reacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzReacting to the Isomorphic Buzz
Reacting to the Isomorphic Buzz
Bruce Coddington
 
Angular basicschat
Angular basicschatAngular basicschat
Angular basicschatYu Jin
 
Understanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - ImrokraftUnderstanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - Imrokraft
imrokraft
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
Emanuele DelBono
 
Infinum iOS Talks #4 - Making our VIPER more reactive
Infinum iOS Talks #4 - Making our VIPER more reactiveInfinum iOS Talks #4 - Making our VIPER more reactive
Infinum iOS Talks #4 - Making our VIPER more reactive
Infinum
 
Angular js
Angular jsAngular js
AngularJS
AngularJSAngularJS
AngularJS
Malin De Silva
 
Binary Studio Academy PRO. JS course. Lecture 2. backbone
Binary Studio Academy PRO. JS course. Lecture 2. backboneBinary Studio Academy PRO. JS course. Lecture 2. backbone
Binary Studio Academy PRO. JS course. Lecture 2. backbone
Binary Studio
 
Angular js
Angular jsAngular js
Angular js
Baldeep Sohal
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIMarcin Grzywaczewski
 
AngularJS
AngularJSAngularJS
AngularJS
LearningTech
 
modularity à la taliban
modularity à la talibanmodularity à la taliban
modularity à la taliban
jonsterling
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
Kamil Augustynowicz
 

What's hot (20)

Introducing angular
Introducing angularIntroducing angular
Introducing angular
 
React vs-angular-mobile
React vs-angular-mobileReact vs-angular-mobile
React vs-angular-mobile
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to react
 
React introduction
React introductionReact introduction
React introduction
 
Marrying angular rails
Marrying angular railsMarrying angular rails
Marrying angular rails
 
2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro2013 - Nate Abele Wield AngularJS like a Pro
2013 - Nate Abele Wield AngularJS like a Pro
 
Reacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzReacting to the Isomorphic Buzz
Reacting to the Isomorphic Buzz
 
Angular basicschat
Angular basicschatAngular basicschat
Angular basicschat
 
Understanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - ImrokraftUnderstanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - Imrokraft
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcing
 
Infinum iOS Talks #4 - Making our VIPER more reactive
Infinum iOS Talks #4 - Making our VIPER more reactiveInfinum iOS Talks #4 - Making our VIPER more reactive
Infinum iOS Talks #4 - Making our VIPER more reactive
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS
AngularJSAngularJS
AngularJS
 
Binary Studio Academy PRO. JS course. Lecture 2. backbone
Binary Studio Academy PRO. JS course. Lecture 2. backboneBinary Studio Academy PRO. JS course. Lecture 2. backbone
Binary Studio Academy PRO. JS course. Lecture 2. backbone
 
Angular js
Angular jsAngular js
Angular js
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
AngularJS
AngularJSAngularJS
AngularJS
 
modularity à la taliban
modularity à la talibanmodularity à la taliban
modularity à la taliban
 
Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
 
Scheduler_session
Scheduler_sessionScheduler_session
Scheduler_session
 

Viewers also liked

Hojadevidapersonal1.docx
Hojadevidapersonal1.docxHojadevidapersonal1.docx
Hojadevidapersonal1.docx
Aleja Chalama
 
Casos
CasosCasos
El romance tg
El romance tgEl romance tg
El romance tg
Cristina Dassum
 
شهادات محمد عطية.PDF
شهادات محمد عطية.PDFشهادات محمد عطية.PDF
شهادات محمد عطية.PDFMohammed Timraz
 
Harinanden New Resume v5
Harinanden New Resume v5Harinanden New Resume v5
Harinanden New Resume v5Harinanden VK
 
R. Seth Penny-Percentage Paper
R. Seth Penny-Percentage PaperR. Seth Penny-Percentage Paper
R. Seth Penny-Percentage PaperRohan Seth
 
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
(2011) Rigaud, David, Daudet - A Parametric Model of Piano TuningFrançois Rigaud
 
the 21st Century Digital Learner
the 21st Century Digital Learnerthe 21st Century Digital Learner
the 21st Century Digital Learner
charmesintos123
 
Ptpp5 kizomba
Ptpp5 kizombaPtpp5 kizomba
Eco borbur ingenieros constructores
Eco borbur ingenieros constructoresEco borbur ingenieros constructores
Eco borbur ingenieros constructores
Jennsy Gonzalez
 
Smokeless tobacco
Smokeless tobaccoSmokeless tobacco
Smokeless tobacco
Ankit Verma
 

Viewers also liked (16)

Hojadevidapersonal1.docx
Hojadevidapersonal1.docxHojadevidapersonal1.docx
Hojadevidapersonal1.docx
 
Casos
CasosCasos
Casos
 
Zimmilo ENG July 2016
Zimmilo ENG July 2016Zimmilo ENG July 2016
Zimmilo ENG July 2016
 
Resume_Mayalagu updated
Resume_Mayalagu updatedResume_Mayalagu updated
Resume_Mayalagu updated
 
El romance tg
El romance tgEl romance tg
El romance tg
 
شهادات محمد عطية.PDF
شهادات محمد عطية.PDFشهادات محمد عطية.PDF
شهادات محمد عطية.PDF
 
Flyer 4x9
Flyer 4x9Flyer 4x9
Flyer 4x9
 
progress_PPT
progress_PPTprogress_PPT
progress_PPT
 
Harinanden New Resume v5
Harinanden New Resume v5Harinanden New Resume v5
Harinanden New Resume v5
 
R. Seth Penny-Percentage Paper
R. Seth Penny-Percentage PaperR. Seth Penny-Percentage Paper
R. Seth Penny-Percentage Paper
 
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
 
Forxtrust
ForxtrustForxtrust
Forxtrust
 
the 21st Century Digital Learner
the 21st Century Digital Learnerthe 21st Century Digital Learner
the 21st Century Digital Learner
 
Ptpp5 kizomba
Ptpp5 kizombaPtpp5 kizomba
Ptpp5 kizomba
 
Eco borbur ingenieros constructores
Eco borbur ingenieros constructoresEco borbur ingenieros constructores
Eco borbur ingenieros constructores
 
Smokeless tobacco
Smokeless tobaccoSmokeless tobacco
Smokeless tobacco
 

Similar to Moving From AngularJS to Angular 2

Angular js 2
Angular js 2Angular js 2
Angular js 2
Ran Wahle
 
Angular
AngularAngular
Introduction to Angular2
Introduction to Angular2Introduction to Angular2
Introduction to Angular2
Ivan Matiishyn
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
Troy Miles
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptx
shekharmpatil1309
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
Commit University
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
Troy Miles
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
Betclic Everest Group Tech Team
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
Yakov Fain
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
murtazahaveliwala
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
Levi Fuller
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
Ravi Mone
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
Rohit Bishnoi
 
Angular2
Angular2Angular2
Angular2
SitaPrajapati
 
Angular js 2.0 beta
Angular js 2.0 betaAngular js 2.0 beta
Angular js 2.0 beta
Nagaraju Sangam
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Anuradha Bandara
 

Similar to Moving From AngularJS to Angular 2 (20)

Angular js 2
Angular js 2Angular js 2
Angular js 2
 
Angular
AngularAngular
Angular
 
Introduction to Angular2
Introduction to Angular2Introduction to Angular2
Introduction to Angular2
 
What's new in Angular 2?
What's new in Angular 2?What's new in Angular 2?
What's new in Angular 2?
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptx
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN Stack
 
Mini-Training: AngularJS
Mini-Training: AngularJSMini-Training: AngularJS
Mini-Training: AngularJS
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java Developers
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
Building Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET CoreBuilding Blocks of Angular 2 and ASP.NET Core
Building Blocks of Angular 2 and ASP.NET Core
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type script
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
Angular2
Angular2Angular2
Angular2
 
Angular js 2.0 beta
Angular js 2.0 betaAngular js 2.0 beta
Angular js 2.0 beta
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 

Recently uploaded

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 

Recently uploaded (20)

A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 

Moving From AngularJS to Angular 2

  • 1. Moving From AngularJS to Angular 2 By Ahamed Imran @immysl
  • 2. “AngularJS is a framework. Angular 2 is a platform” - Brad Green -
  • 3. Why Angular 2? • Cross platform • Very good performance • Good tooling support (IDEs and CLI tool) • Ecosystem — RxJS, TypeScript, NativeScript, etc. • Very good mobile support
  • 4. “The value in TypeScript is in writing safer code” - John Papa -
  • 5. Why TypeScript? • Check for errors at compile time • Good tooling support • Is a mix of types, ES2015 and ESNext • The fastest growing superset of JavaScript • Compatibility with non-TypeScript libraries
  • 6.
  • 7. What has changed? • There are components — No controllers • There are services — No providers and factories • There are zones — No $scope • There are APIs for DOM manipulation — No jqLite • One way data flow — No two way data flow
  • 8.
  • 9. Angular 2 Concepts • Components • Dependency Injection • Data Binding • Metadata / decorators • Modules
  • 10. Components • Inputs • Outputs / events • Lifecycle • Providers • Template
  • 11. Components Example @Component({ selector: 'my-component', providers: [MyService], template: ‘<p *ngFor=”let item of list” (click)=”sendUpdate()”>{{ item }}</p>’, styles: [‘p { font-size: 14px }’] }) class MyComponent implements OnInit { @Input() list; @Output() update = new EventEmitter(); ngOnInit() { } // get async data sendUpdate() { this.update.emit(‘some value’) } }
  • 12. Dependency Injection Example @Component({ ... providers: [MyService] }) export class MyComponent { constructor(private service: MyService) {} // inject here ngOnInit() { service.getList(); // this is just a dummy line } }
  • 13. Data Binding • Interpolation • Property binding (inputs) • Event binding (outputs) • Two-way binding // example <my-component [title]=”list” (update)=”getUpdate($event)”></my-component>
  • 14. Metadata / Decorators @Component({ selector: '...', template: ‘<h2>{{title}}</h2>’ }) // common decorators @Input() @Output() @Pipe() @Injectable()
  • 15. Modules • Brand new — released yesterday • Somewhat similar to AngularJS module • An app needs to have a root module • Separate modules based on features • Not same as JavaScript / TypeScript modules
  • 16. Modules Example import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; Import { MyComponent } from ‘./my.component’; @NgModule({ imports: [BrowserModule], providers: [MyService], declarations: [MyComponent, MyDirective, MyPipe], bootstrap: [AppComponent] }) export class AppModule { }
  • 17. Angular Libraries • Router • Form • Upgrade • Compiler • Compiler-cli
  • 18.
  • 19. Angular CLI • Official scaffolding and build tool for Angular 2 • Maintained by the Angular team • Latest uses Webpack for build and server • Currently as a command-line tool only
  • 20. Other Tools • Codelyzer — style guide checker • Augury — Angular 2 debugger as a Chrome extension • Lite-server — A live reload server for Angular
  • 21. Demo
  • 22. Norway +47 959 23 712 oslo@exilesoft.com Stortorvet 10 0155 Oslo Norway Sweden +46 735 194 442 stockholm@exilesoft.com Stockholmsvägen 33 181 33 Lidingö Sweden Australia +61 412 446 105 sydney@exilesoft.com Suite2.14, 32 Delhi Road North Ryde, NSW 2113 Australia Sri Lanka +94 112 300 900 colombo@exilesoft.com 201, Sir James Peiris Mw. Colombo 02 Sri Lanka www.exilesoft.com