SlideShare une entreprise Scribd logo
1  sur  22
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

Contenu connexe

Tendances

Introduction to react
Introduction to reactIntroduction to react
Introduction to reactkiranabburi
 
Marrying angular rails
Marrying angular railsMarrying angular rails
Marrying angular railsVolker 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 ProPHP Conference Argentina
 
Reacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzReacting to the Isomorphic Buzz
Reacting to the Isomorphic BuzzBruce Coddington
 
Angular basicschat
Angular basicschatAngular basicschat
Angular basicschatYu Jin
 
Understanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - ImrokraftUnderstanding Javascript AJAX - Imrokraft
Understanding Javascript AJAX - Imrokraftimrokraft
 
From ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingFrom ActiveRecord to EventSourcing
From ActiveRecord to EventSourcingEmanuele 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 reactiveInfinum
 
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. backboneBinary Studio
 
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
 
modularity à la taliban
modularity à la talibanmodularity à la taliban
modularity à la talibanjonsterling
 
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.11Kamil Augustynowicz
 

Tendances (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
 

En vedette

En vedette (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
 

Similaire à Moving From AngularJS to Angular 2

Angular js 2
Angular js 2Angular js 2
Angular js 2Ran Wahle
 
Introduction to Angular2
Introduction to Angular2Introduction to Angular2
Introduction to Angular2Ivan Matiishyn
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-upTroy Miles
 
angular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxangular-concepts-introduction-slides.pptx
angular-concepts-introduction-slides.pptxshekharmpatil1309
 
Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next FrameworkCommit University
 
From MEAN to the MERN Stack
From MEAN to the MERN StackFrom MEAN to the MERN Stack
From MEAN to the MERN StackTroy Miles
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction TutorialScott Lee
 
Angular 4 for Java Developers
Angular 4 for Java DevelopersAngular 4 for Java Developers
Angular 4 for Java DevelopersYakov Fain
 
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 CoreLevi Fuller
 
Angular2 with type script
Angular2 with type scriptAngular2 with type script
Angular2 with type scriptRavi Mone
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript Rohit Bishnoi
 
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
 

Similaire à 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
 

Dernier

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Dernier (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

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