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
Moving From AngularJS to  Angular 2
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
Moving From AngularJS to  Angular 2
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
Moving From AngularJS to  Angular 2
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

PPTX
Angular js for Beginnners
PDF
PPTX
Introduction to Angular JS
PDF
Introduction to VIPER Architecture
PDF
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
PPTX
Angular JS Indtrodution
PDF
Understanding Facebook's React.js
PPTX
Lets go vanilla
Angular js for Beginnners
Introduction to Angular JS
Introduction to VIPER Architecture
Infinum iOS Talks #2 - VIPER for everybody by Damjan Vujaklija
Angular JS Indtrodution
Understanding Facebook's React.js
Lets go vanilla

What's hot (20)

PPTX
Introducing angular
PDF
React vs-angular-mobile
PDF
Introduction to react
PPSX
React introduction
PDF
Marrying angular rails
PDF
2013 - Nate Abele Wield AngularJS like a Pro
PDF
Reacting to the Isomorphic Buzz
PDF
Angular basicschat
PPTX
Understanding Javascript AJAX - Imrokraft
PDF
From ActiveRecord to EventSourcing
PDF
Infinum iOS Talks #4 - Making our VIPER more reactive
PPTX
PPTX
AngularJS
PPTX
Binary Studio Academy PRO. JS course. Lecture 2. backbone
PPTX
Angular js
PDF
React.js - and how it changed our thinking about UI
PPTX
AngularJS
PDF
modularity à la taliban
PDF
Angular js 2.0, ng poznań 20.11
ODP
Scheduler_session
Introducing angular
React vs-angular-mobile
Introduction to react
React introduction
Marrying angular rails
2013 - Nate Abele Wield AngularJS like a Pro
Reacting to the Isomorphic Buzz
Angular basicschat
Understanding Javascript AJAX - Imrokraft
From ActiveRecord to EventSourcing
Infinum iOS Talks #4 - Making our VIPER more reactive
AngularJS
Binary Studio Academy PRO. JS course. Lecture 2. backbone
Angular js
React.js - and how it changed our thinking about UI
AngularJS
modularity à la taliban
Angular js 2.0, ng poznań 20.11
Scheduler_session
Ad

Viewers also liked (16)

PDF
Hojadevidapersonal1.docx
DOCX
PPTX
Zimmilo ENG July 2016
PDF
Resume_Mayalagu updated
PPTX
El romance tg
PDF
شهادات محمد عطية.PDF
PDF
PPTX
progress_PPT
DOCX
Harinanden New Resume v5
DOCX
R. Seth Penny-Percentage Paper
PDF
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
PPTX
Forxtrust
PPTX
the 21st Century Digital Learner
PDF
Eco borbur ingenieros constructores
PPTX
Smokeless tobacco
Hojadevidapersonal1.docx
Zimmilo ENG July 2016
Resume_Mayalagu updated
El romance tg
شهادات محمد عطية.PDF
progress_PPT
Harinanden New Resume v5
R. Seth Penny-Percentage Paper
(2011) Rigaud, David, Daudet - A Parametric Model of Piano Tuning
Forxtrust
the 21st Century Digital Learner
Eco borbur ingenieros constructores
Smokeless tobacco
Ad

Similar to Moving From AngularJS to Angular 2 (20)

PDF
better-apps-angular-2-day1.pdf and home
PPTX
Angular js 2
PPTX
yrs of IT experience in enterprise programming
PPTX
Introduction to Angular2
PPTX
What's new in Angular 2?
PDF
MEAN Stack Warm-up
PPTX
angular-concepts-introduction-slides.pptx
PDF
Angular 2 - The Next Framework
PDF
From MEAN to the MERN Stack
PDF
Mini-Training: AngularJS
PPTX
Angular 4 Introduction Tutorial
PDF
Angular 4 for Java Developers
PPTX
Angularjs Basics
PPTX
Introduction to AngularJs
PDF
Building Blocks of Angular 2 and ASP.NET Core
PDF
Angular2 with type script
PDF
Angular2 with TypeScript
PDF
Angular2
PPTX
Angular js 2.0 beta
better-apps-angular-2-day1.pdf and home
Angular js 2
yrs of IT experience in enterprise programming
Introduction to Angular2
What's new in Angular 2?
MEAN Stack Warm-up
angular-concepts-introduction-slides.pptx
Angular 2 - The Next Framework
From MEAN to the MERN Stack
Mini-Training: AngularJS
Angular 4 Introduction Tutorial
Angular 4 for Java Developers
Angularjs Basics
Introduction to AngularJs
Building Blocks of Angular 2 and ASP.NET Core
Angular2 with type script
Angular2 with TypeScript
Angular2
Angular js 2.0 beta

Recently uploaded (20)

PPTX
Python is a high-level, interpreted programming language
PPTX
Computer Software - Technology and Livelihood Education
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
Microsoft Office 365 Crack Download Free
PPTX
Introduction to Windows Operating System
PDF
AI Guide for Business Growth - Arna Softech
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PPTX
Trending Python Topics for Data Visualization in 2025
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
PDF
Workplace Software and Skills - OpenStax
PDF
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PDF
Visual explanation of Dijkstra's Algorithm using Python
PPTX
most interesting chapter in the world ppt
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Python is a high-level, interpreted programming language
Computer Software - Technology and Livelihood Education
CCleaner 6.39.11548 Crack 2025 License Key
Microsoft Office 365 Crack Download Free
Introduction to Windows Operating System
AI Guide for Business Growth - Arna Softech
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
Trending Python Topics for Data Visualization in 2025
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Full-Stack Developer Courses That Actually Land You Jobs
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
AI/ML Infra Meetup | LLM Agents and Implementation Challenges
Workplace Software and Skills - OpenStax
The Dynamic Duo Transforming Financial Accounting Systems Through Modern Expe...
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
How to Use SharePoint as an ISO-Compliant Document Management System
Visual explanation of Dijkstra's Algorithm using Python
most interesting chapter in the world ppt
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]

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
  • 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
  • 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
  • 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 [email protected] Stortorvet 10 0155 Oslo Norway Sweden +46 735 194 442 [email protected] Stockholmsvägen 33 181 33 Lidingö Sweden Australia +61 412 446 105 [email protected] Suite2.14, 32 Delhi Road North Ryde, NSW 2113 Australia Sri Lanka +94 112 300 900 [email protected] 201, Sir James Peiris Mw. Colombo 02 Sri Lanka www.exilesoft.com