SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
1
Angular 2.0:
Migration paths from 1.x to 2.0
Manfred Steyer
About me …
Manfred Steyer
Trainer & Consultant
Angular & .NET
Page  2
2
Contents
 General Approaches
 Preparation
 Components in AngularJS 1.5
 Component Router in AngularJS 1.x
 ES6 and TypeScript
 Overview of Decorators and ng-forward
 Migration
 ngUpgrade
Page  3
GENERAL APPROACHES
Page  5
3
Ostrich-Strategy
Page  6
[https://creativecommons.org/licenses/by/2.0/]
[(c) weisserstier, 110613_Straussenland 089, http://tinyurl.com/jza7wcy]
Microservice Approach
Page  7
Module 1
AngularJS 1.x
Module 2
Angular 2
Module 3
Angular 2
4
(Stepwise) Migration
Page  8
FlightCard
FlightSvc
FlightList
App1
1
1
1
(Stepwise) Migration with ngUpgrade
Page  9
FlightCard
FlightSvc
FlightList
App1
1
2
2
5
(Stepwise) Migration with ngUpgrade
Page  10
FlightCard
FlightSvc
PassengerCard
PassengerSvc
FlightList PassengerList
App1
1
1
1
2
2
2
(Stepwise) Migration with ngUpgrade
Page  11
FlightCard
FlightSvc
PassengerCard
PassengerSvc
FlightList PassengerList
App2
2
2
2
2
2
2
6
Two Steps
Preparation Migration
Page  12
PREPARATION
Page  13
7
Components in Angular 2
Page  16
Component
Controller
Template
Controller
Page  19
Controller Template
Scope
x
y
z
8
Controller
Page  20
Controller Template
Scope
vm
Controller-as
Page  21
Controller Template
Scope
myCtrl
<div ng-controller="Controller as myCtrl">
[…]
</div>
new
9
Controller-as
Page  22
Controller Template
Scope
myCtrl
<div ng-controller="Controller as myCtrl">
<input ng-model="myCtrl.from">
<input ng-model="myCtrl.to">
[…]
</div>
new
Constructor-Function for Controller
Page  23
function FlightListController($http, $log) {
this.from = "Graz";
this.to = "Hamburg";
this.selectedFlight = null;
this.flights = [];
this.message = "";
this.search = function() { … }
this.select = function() { … }
}
10
Controller-as and UI-Router
Page  24
$stateProvider.state('home', {
url: '/home',
templateUrl: '/app/home/home.html',
controller: 'home',
controllerAs: 'home'
})
ControllerAs and Directives
Page  25
app.directive('passengerCard', function() {
return {
restrict: 'E',
templateUrl: '…',
controller: function() {
this.select = function() {
this.selectedItem = this.item;
}
},
controllerAs: 'myCtrl',
scope: {
item: '=',
selectedItem: '='
},
bindToController: true
}
});
<passenger-card
item="myPassenger"
selectedItem="selected">
</passagier-card>
<a ng-click="myCtrl.select()">
…
</a>
11
ControllerAs and Directives
Page  26
app.directive('passengerCard', function() {
return {
restrict: 'E',
templateUrl: '…',
controller: function() {
this.select = function() {
this.selectedItem = this.item;
}
},
controllerAs: 'myCtrl',
bindToController: {
item: '=',
selectedItem: '='
}
}
});
<passenger-card
item="myPassenger"
selectedItem="selected">
</passagier-card>
<a ng-click="myCtrl.select()">
…
</a>
Components in Angular 1.5
Page  27
app.component('passengerCard', {
templateUrl: '[…]',
controller: function() {
this.select = () => {
this.selectedItem = this.item;
}
},
controllerAs: 'myCtrl', // <-- Default: $ctrl
bindings: {
item: '=',
selectedItem: '='
}
});
12
Components in ng1.5
Page  28
restrict: 'E' scope: {} bindToController
controllerAs
(Default $ctrl)
No compile No link
No replace
Recap
controllerAs
bindToController
Components in Angular 1.5
Page  29
13
COMPONENT ROUTER
IN ANGULAR 1.X
Page  30
Why Component Router in Angular 1.5
Routing-Solution for Angular 2
Back-ported to Angular 1.x
Directly activates Components
Makes Migration to Angular 2 easier
Page  31
14
Components and UI-Router
Page  32
$stateProvider.state('passenger-list', {
url: '/passenger-list',
template: '<passenger-list></passenger-list>'
});
Component Router in Angular 1.x
Page  33
app.component('home', { … });
app.component('bookFlight', { … });
app.component('app', {
controller: AppController,
controllerAs: 'app',
templateUrl: "app.html",
$routeConfig: [
{ path: '/', component: 'home',
name: 'Home', useAsDefault: true },
{ path: '/bookFlight', component: 'bookFlight',
name: 'BookFlight' }
]
});
app.value('$routerRootComponent', 'app');
15
TYPESCRIPT AND ES 6
Page  36
TypeScriptES 6
ES 5 < ES 6 < TypeScript
Page  37
ES 5
16
Controller in ES 6
Page  38
export class FlightSearchController {
constructor() {
this.from = "Vienna";
this.to = "London";
}
search() { […] }
select(flight) { […] }
}
import {FlightSearchController} from './some-file';
var ctrl = new FlightSearchController();
Controller in TypeScript
Page  39
export class FlightSearchController {
public from: string;
public to: string;
constructor() {
this.from = "Vienna";
this.to = "London";
}
public search() { […] }
public select() { […] }
}
17
Using EcmaScript 6 today
Compile to ES5 („Transpilation“)
Popular Transpiler: Babel
Page  40
Using TypeScript today
TypeScript-Compiler compiles TypeScript
down to ES6, ES5 oder ES3
Page  41
18
NG-FORWARD
Page  42
NG-Forward
Page  43
19
Recap
Page  44
 controller-as, bindToController, .component
 ES6/ TypeScript
 Decorators and ngForward
 Component Router in AngularJS 1.x
Recap
Page  45
 controller-as, bindToController, .component
 ES6/ TypeScript
 Decorators and ngForward
 Component Router in AngularJS 1.x
20
NGUPGRADE
Page  46
ngUpgrade
Page  47
FlightCard
FlightSvc
PassengerCard
PassengerSvc
FlightList PassengerList
App1
1
1
1
2
2
2
21
What do we need?
AngularJS 1.x
Angular 2 (+ upgrade.js)
Page  48
Bootstrapping
Page  50
import {upgradeAdapter} from './upgrade-adapter';
// Upgrade, Downgrade
upgradeAdapter.bootstrap(document.body, ['app']);
Instead of ng-app bzw. angular.bootstrap
22
UpgradeAdapter
Page  51
upgradeNg1
Component
upgradeNg1
Provider
downgradeNg2
Component
downgradeNg2
Provider
addProvider
(DI for ng2)
DEMO
Page  52
23
ngUpgrade
Page  54
FlightCard
FlightSvc
PassengerCard
PassengerSvc
FlightList PassengerList
App1
1
1
1
2
2
2
manfred.steyer@SOFTWAREarchitekt.at
SOFTWAREarchitekt.at
ManfredSteyer
Contact

Más contenido relacionado

La actualidad más candente

What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...Edureka!
 
What’s new in angular 12[highlights of angular 12 features]
What’s new in angular 12[highlights of angular 12 features]What’s new in angular 12[highlights of angular 12 features]
What’s new in angular 12[highlights of angular 12 features]Katy Slemon
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaEdureka!
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An OverviewJalpesh Vadgama
 
PPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPaddy Lock
 
Angular 4 fronts
Angular 4 frontsAngular 4 fronts
Angular 4 frontsbadal dubla
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Ahmed Bouchefra
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core ConceptsFabio Biondi
 
Angular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and WorkshopAngular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and WorkshopNitin Bhojwani
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction TutorialScott Lee
 
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Edureka!
 
What’s new in angular 2
What’s new in angular 2What’s new in angular 2
What’s new in angular 2Ran Wahle
 
Angular, the New Angular JS
Angular, the New Angular JSAngular, the New Angular JS
Angular, the New Angular JSKenzan
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2Dhyego Fernando
 

La actualidad más candente (20)

What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
What's New in Angular 4 | Angular 4 Features | Angular 4 Changes | Angular Tu...
 
What’s new in angular 12[highlights of angular 12 features]
What’s new in angular 12[highlights of angular 12 features]What’s new in angular 12[highlights of angular 12 features]
What’s new in angular 12[highlights of angular 12 features]
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
 
PPT on Angular 2 Development Tutorial
PPT on Angular 2 Development TutorialPPT on Angular 2 Development Tutorial
PPT on Angular 2 Development Tutorial
 
Angular 4 fronts
Angular 4 frontsAngular 4 fronts
Angular 4 fronts
 
Angular 9 New features
Angular 9 New featuresAngular 9 New features
Angular 9 New features
 
Angular 4 - quick view
Angular 4 - quick viewAngular 4 - quick view
Angular 4 - quick view
 
Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps Learn Angular 9/8 In Easy Steps
Learn Angular 9/8 In Easy Steps
 
Angular 2
Angular 2Angular 2
Angular 2
 
Angular 2 - Core Concepts
Angular 2 - Core ConceptsAngular 2 - Core Concepts
Angular 2 - Core Concepts
 
Ionic 2 - Introduction
Ionic 2 - IntroductionIonic 2 - Introduction
Ionic 2 - Introduction
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
 
Angular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and WorkshopAngular Meetup 1 - Angular Basics and Workshop
Angular Meetup 1 - Angular Basics and Workshop
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
Angular 2 Training | Angular 2 Tutorial For Beginners | Angular Certification...
 
What’s new in angular 2
What’s new in angular 2What’s new in angular 2
What’s new in angular 2
 
Advantages of angular 8
Advantages of angular 8Advantages of angular 8
Advantages of angular 8
 
Angular, the New Angular JS
Angular, the New Angular JSAngular, the New Angular JS
Angular, the New Angular JS
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 

Destacado

Dotsoft in a nutshell
Dotsoft in a nutshellDotsoft in a nutshell
Dotsoft in a nutshellDotsoft SA
 
Der neueste neue Router (Version 3) für Angular 2
Der neueste neue Router (Version 3) für Angular 2Der neueste neue Router (Version 3) für Angular 2
Der neueste neue Router (Version 3) für Angular 2Manfred Steyer
 
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealty
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealtyKolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealty
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealtySarestates Realty Advisors Pvt Ltd
 
Location Shoot
Location Shoot Location Shoot
Location Shoot sylvieapps
 
Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.	Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co. Manfred Steyer
 
EventQuest by Questment
EventQuest by Questment EventQuest by Questment
EventQuest by Questment Dotsoft SA
 
Cleaner cars from cradle to grave full report
Cleaner cars from cradle to grave full reportCleaner cars from cradle to grave full report
Cleaner cars from cradle to grave full reportFrédéric Lambert
 
Moderne Web-Anwendungen mit Angular 2
Moderne Web-Anwendungen mit Angular 2Moderne Web-Anwendungen mit Angular 2
Moderne Web-Anwendungen mit Angular 2Manfred Steyer
 
Apostila de excel com matemática financeira
Apostila de excel com matemática financeiraApostila de excel com matemática financeira
Apostila de excel com matemática financeiraLuiz Avelar
 
Curso basicão de violão
Curso basicão de violão Curso basicão de violão
Curso basicão de violão Luiz Avelar
 

Destacado (11)

Dotsoft in a nutshell
Dotsoft in a nutshellDotsoft in a nutshell
Dotsoft in a nutshell
 
Der neueste neue Router (Version 3) für Angular 2
Der neueste neue Router (Version 3) für Angular 2Der neueste neue Router (Version 3) für Angular 2
Der neueste neue Router (Version 3) für Angular 2
 
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealty
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealtyKolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealty
Kolte patil | western avenue | 99671 55511 | wakad, Pune | Way2wealthrealty
 
Location Shoot
Location Shoot Location Shoot
Location Shoot
 
Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.	Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.
 
Wadhwa courtyard | 99679 06996 | Way2wealthrealty
Wadhwa courtyard | 99679 06996 | Way2wealthrealtyWadhwa courtyard | 99679 06996 | Way2wealthrealty
Wadhwa courtyard | 99679 06996 | Way2wealthrealty
 
EventQuest by Questment
EventQuest by Questment EventQuest by Questment
EventQuest by Questment
 
Cleaner cars from cradle to grave full report
Cleaner cars from cradle to grave full reportCleaner cars from cradle to grave full report
Cleaner cars from cradle to grave full report
 
Moderne Web-Anwendungen mit Angular 2
Moderne Web-Anwendungen mit Angular 2Moderne Web-Anwendungen mit Angular 2
Moderne Web-Anwendungen mit Angular 2
 
Apostila de excel com matemática financeira
Apostila de excel com matemática financeiraApostila de excel com matemática financeira
Apostila de excel com matemática financeira
 
Curso basicão de violão
Curso basicão de violão Curso basicão de violão
Curso basicão de violão
 

Similar a Angular 2: Migration - SSD 2016 London

The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016
The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016
The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016Manfred Steyer
 
ngNewRouter
ngNewRouterngNewRouter
ngNewRouterphidong
 
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0Manfred Steyer
 
Angular 2 and 1.5 Routing
Angular 2 and 1.5 RoutingAngular 2 and 1.5 Routing
Angular 2 and 1.5 RoutingManfred Steyer
 
The new component router for Angular 2 and 1.x
The new component router for Angular 2 and 1.xThe new component router for Angular 2 and 1.x
The new component router for Angular 2 and 1.xManfred Steyer
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2codeandyou forums
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization developmentJohannes Weber
 
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Edureka!
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Frost
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...OdessaJS Conf
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6William Marques
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
The newst new Router for Angular 2 ("Version 3")
The newst new Router for Angular 2 ("Version 3")The newst new Router for Angular 2 ("Version 3")
The newst new Router for Angular 2 ("Version 3")Manfred Steyer
 
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamShubham Verma
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersOswald Campesato
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIVisual Engineering
 

Similar a Angular 2: Migration - SSD 2016 London (20)

The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016
The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016
The newst new Router for Angular 2 - Talk at @angular_berlin, July 2016
 
ngNewRouter
ngNewRouterngNewRouter
ngNewRouter
 
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0
Angular 2 Upgrade: Migration von AngularJS 1.x zu 2.0
 
Angular 2 and 1.5 Routing
Angular 2 and 1.5 RoutingAngular 2 and 1.5 Routing
Angular 2 and 1.5 Routing
 
The new component router for Angular 2 and 1.x
The new component router for Angular 2 and 1.xThe new component router for Angular 2 and 1.x
The new component router for Angular 2 and 1.x
 
Understand routing in angular 2
Understand routing in angular 2Understand routing in angular 2
Understand routing in angular 2
 
A Story about AngularJS modularization development
A Story about AngularJS modularization developmentA Story about AngularJS modularization development
A Story about AngularJS modularization development
 
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
Angular Routing Tutorial | AngularJS vs Angular Router | Angular Training | E...
 
Angular js 2.0 beta
Angular js 2.0 betaAngular js 2.0 beta
Angular js 2.0 beta
 
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
Building an angular application -1 ( API: Golang, Database: Postgres) v1.0
 
Angular routing
Angular routingAngular routing
Angular routing
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
 
Angular 2 - Better or worse
Angular 2 - Better or worseAngular 2 - Better or worse
Angular 2 - Better or worse
 
Angular 2 - a New Hope
Angular 2 - a New HopeAngular 2 - a New Hope
Angular 2 - a New Hope
 
Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6Angular 2 Migration - JHipster Meetup 6
Angular 2 Migration - JHipster Meetup 6
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
The newst new Router for Angular 2 ("Version 3")
The newst new Router for Angular 2 ("Version 3")The newst new Router for Angular 2 ("Version 3")
The newst new Router for Angular 2 ("Version 3")
 
Angular2RoutingSetupByShubham
Angular2RoutingSetupByShubhamAngular2RoutingSetupByShubham
Angular2RoutingSetupByShubham
 
Angular1x and Angular 2 for Beginners
Angular1x and Angular 2 for BeginnersAngular1x and Angular 2 for Beginners
Angular1x and Angular 2 for Beginners
 
Workshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte IIWorkshop 13: AngularJS Parte II
Workshop 13: AngularJS Parte II
 

Más de Manfred Steyer

Der neue Component Router für Angular 2
Der neue Component Router für Angular 2Der neue Component Router für Angular 2
Der neue Component Router für Angular 2Manfred Steyer
 
Datenbindung und Performance in Angular 2
Datenbindung und Performance in Angular 2Datenbindung und Performance in Angular 2
Datenbindung und Performance in Angular 2Manfred Steyer
 
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/store
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/storeSingle Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/store
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/storeManfred Steyer
 
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2Manfred Steyer
 
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtet
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtetAngular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtet
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtetManfred Steyer
 
Datengetriebene Web APIs mit Entity Framework
Datengetriebene Web APIs mit Entity FrameworkDatengetriebene Web APIs mit Entity Framework
Datengetriebene Web APIs mit Entity FrameworkManfred Steyer
 
Web APIs mit ASP.NET Core 1
Web APIs mit ASP.NET Core 1Web APIs mit ASP.NET Core 1
Web APIs mit ASP.NET Core 1Manfred Steyer
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Manfred Steyer
 
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId Connect
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId ConnectModern authentication solutions in Angular 2 with OAuth 2.0 and OpenId Connect
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId ConnectManfred Steyer
 
Progressive web apps with Angular 2
Progressive web apps with Angular 2Progressive web apps with Angular 2
Progressive web apps with Angular 2Manfred Steyer
 
ASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-DevsASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-DevsManfred Steyer
 
Web APIs mit ASP.NET MVC Core 1
Web APIs mit ASP.NET MVC Core 1Web APIs mit ASP.NET MVC Core 1
Web APIs mit ASP.NET MVC Core 1Manfred Steyer
 
.NET Summit 2016 München: EcmaScript 2015+ with TypeScript
.NET Summit 2016 München: EcmaScript 2015+ with TypeScript.NET Summit 2016 München: EcmaScript 2015+ with TypeScript
.NET Summit 2016 München: EcmaScript 2015+ with TypeScriptManfred Steyer
 
.NET Summit 2016 München: Angular 2 mit TypeScript
.NET Summit 2016 München: Angular 2 mit TypeScript.NET Summit 2016 München: Angular 2 mit TypeScript
.NET Summit 2016 München: Angular 2 mit TypeScriptManfred Steyer
 
Wiederverwendbare Komponenten mit Angular 2.0 – Deep Dive
Wiederverwendbare Komponenten mit Angular 2.0 – Deep DiveWiederverwendbare Komponenten mit Angular 2.0 – Deep Dive
Wiederverwendbare Komponenten mit Angular 2.0 – Deep DiveManfred Steyer
 
Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.	Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co. Manfred Steyer
 
Komponenten mit Angular 2, Deep Dive
Komponenten mit Angular 2, Deep DiveKomponenten mit Angular 2, Deep Dive
Komponenten mit Angular 2, Deep DiveManfred Steyer
 

Más de Manfred Steyer (20)

Der neue Component Router für Angular 2
Der neue Component Router für Angular 2Der neue Component Router für Angular 2
Der neue Component Router für Angular 2
 
Datenbindung und Performance in Angular 2
Datenbindung und Performance in Angular 2Datenbindung und Performance in Angular 2
Datenbindung und Performance in Angular 2
 
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/store
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/storeSingle Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/store
Single Page Applications neu gedacht: Redux in Angular 2 mit @ngrx/store
 
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2
Offlinefähige Browseranwendungen: Progressive Web-Apps mit Angular 2
 
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtet
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtetAngular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtet
Angular 2: Die Ideen hinter Datenbindung und Formularen im Detail betrachtet
 
Datengetriebene Web APIs mit Entity Framework
Datengetriebene Web APIs mit Entity FrameworkDatengetriebene Web APIs mit Entity Framework
Datengetriebene Web APIs mit Entity Framework
 
Web APIs mit ASP.NET Core 1
Web APIs mit ASP.NET Core 1Web APIs mit ASP.NET Core 1
Web APIs mit ASP.NET Core 1
 
Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2Databinding and Performance-Tuning in Angular 2
Databinding and Performance-Tuning in Angular 2
 
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId Connect
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId ConnectModern authentication solutions in Angular 2 with OAuth 2.0 and OpenId Connect
Modern authentication solutions in Angular 2 with OAuth 2.0 and OpenId Connect
 
Progressive web apps with Angular 2
Progressive web apps with Angular 2Progressive web apps with Angular 2
Progressive web apps with Angular 2
 
Webpack
WebpackWebpack
Webpack
 
ASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-DevsASP.NET Core 1 for MVC- and WebAPI-Devs
ASP.NET Core 1 for MVC- and WebAPI-Devs
 
Was bringt Angular 2?
Was bringt Angular 2?Was bringt Angular 2?
Was bringt Angular 2?
 
Web APIs mit ASP.NET MVC Core 1
Web APIs mit ASP.NET MVC Core 1Web APIs mit ASP.NET MVC Core 1
Web APIs mit ASP.NET MVC Core 1
 
.NET Summit 2016 München: EcmaScript 2015+ with TypeScript
.NET Summit 2016 München: EcmaScript 2015+ with TypeScript.NET Summit 2016 München: EcmaScript 2015+ with TypeScript
.NET Summit 2016 München: EcmaScript 2015+ with TypeScript
 
.NET Summit 2016 München: Angular 2 mit TypeScript
.NET Summit 2016 München: Angular 2 mit TypeScript.NET Summit 2016 München: Angular 2 mit TypeScript
.NET Summit 2016 München: Angular 2 mit TypeScript
 
Wiederverwendbare Komponenten mit Angular 2.0 – Deep Dive
Wiederverwendbare Komponenten mit Angular 2.0 – Deep DiveWiederverwendbare Komponenten mit Angular 2.0 – Deep Dive
Wiederverwendbare Komponenten mit Angular 2.0 – Deep Dive
 
Angular 2: Routing
Angular 2: RoutingAngular 2: Routing
Angular 2: Routing
 
Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.	Datenbasierte Services mit Entity Framework und Co.
Datenbasierte Services mit Entity Framework und Co.
 
Komponenten mit Angular 2, Deep Dive
Komponenten mit Angular 2, Deep DiveKomponenten mit Angular 2, Deep Dive
Komponenten mit Angular 2, Deep Dive
 

Último

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...SUHANI PANDEY
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 

Último (20)

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 

Angular 2: Migration - SSD 2016 London

  • 1. 1 Angular 2.0: Migration paths from 1.x to 2.0 Manfred Steyer About me … Manfred Steyer Trainer & Consultant Angular & .NET Page  2
  • 2. 2 Contents  General Approaches  Preparation  Components in AngularJS 1.5  Component Router in AngularJS 1.x  ES6 and TypeScript  Overview of Decorators and ng-forward  Migration  ngUpgrade Page  3 GENERAL APPROACHES Page  5
  • 3. 3 Ostrich-Strategy Page  6 [https://creativecommons.org/licenses/by/2.0/] [(c) weisserstier, 110613_Straussenland 089, http://tinyurl.com/jza7wcy] Microservice Approach Page  7 Module 1 AngularJS 1.x Module 2 Angular 2 Module 3 Angular 2
  • 4. 4 (Stepwise) Migration Page  8 FlightCard FlightSvc FlightList App1 1 1 1 (Stepwise) Migration with ngUpgrade Page  9 FlightCard FlightSvc FlightList App1 1 2 2
  • 5. 5 (Stepwise) Migration with ngUpgrade Page  10 FlightCard FlightSvc PassengerCard PassengerSvc FlightList PassengerList App1 1 1 1 2 2 2 (Stepwise) Migration with ngUpgrade Page  11 FlightCard FlightSvc PassengerCard PassengerSvc FlightList PassengerList App2 2 2 2 2 2 2
  • 6. 6 Two Steps Preparation Migration Page  12 PREPARATION Page  13
  • 7. 7 Components in Angular 2 Page  16 Component Controller Template Controller Page  19 Controller Template Scope x y z
  • 8. 8 Controller Page  20 Controller Template Scope vm Controller-as Page  21 Controller Template Scope myCtrl <div ng-controller="Controller as myCtrl"> […] </div> new
  • 9. 9 Controller-as Page  22 Controller Template Scope myCtrl <div ng-controller="Controller as myCtrl"> <input ng-model="myCtrl.from"> <input ng-model="myCtrl.to"> […] </div> new Constructor-Function for Controller Page  23 function FlightListController($http, $log) { this.from = "Graz"; this.to = "Hamburg"; this.selectedFlight = null; this.flights = []; this.message = ""; this.search = function() { … } this.select = function() { … } }
  • 10. 10 Controller-as and UI-Router Page  24 $stateProvider.state('home', { url: '/home', templateUrl: '/app/home/home.html', controller: 'home', controllerAs: 'home' }) ControllerAs and Directives Page  25 app.directive('passengerCard', function() { return { restrict: 'E', templateUrl: '…', controller: function() { this.select = function() { this.selectedItem = this.item; } }, controllerAs: 'myCtrl', scope: { item: '=', selectedItem: '=' }, bindToController: true } }); <passenger-card item="myPassenger" selectedItem="selected"> </passagier-card> <a ng-click="myCtrl.select()"> … </a>
  • 11. 11 ControllerAs and Directives Page  26 app.directive('passengerCard', function() { return { restrict: 'E', templateUrl: '…', controller: function() { this.select = function() { this.selectedItem = this.item; } }, controllerAs: 'myCtrl', bindToController: { item: '=', selectedItem: '=' } } }); <passenger-card item="myPassenger" selectedItem="selected"> </passagier-card> <a ng-click="myCtrl.select()"> … </a> Components in Angular 1.5 Page  27 app.component('passengerCard', { templateUrl: '[…]', controller: function() { this.select = () => { this.selectedItem = this.item; } }, controllerAs: 'myCtrl', // <-- Default: $ctrl bindings: { item: '=', selectedItem: '=' } });
  • 12. 12 Components in ng1.5 Page  28 restrict: 'E' scope: {} bindToController controllerAs (Default $ctrl) No compile No link No replace Recap controllerAs bindToController Components in Angular 1.5 Page  29
  • 13. 13 COMPONENT ROUTER IN ANGULAR 1.X Page  30 Why Component Router in Angular 1.5 Routing-Solution for Angular 2 Back-ported to Angular 1.x Directly activates Components Makes Migration to Angular 2 easier Page  31
  • 14. 14 Components and UI-Router Page  32 $stateProvider.state('passenger-list', { url: '/passenger-list', template: '<passenger-list></passenger-list>' }); Component Router in Angular 1.x Page  33 app.component('home', { … }); app.component('bookFlight', { … }); app.component('app', { controller: AppController, controllerAs: 'app', templateUrl: "app.html", $routeConfig: [ { path: '/', component: 'home', name: 'Home', useAsDefault: true }, { path: '/bookFlight', component: 'bookFlight', name: 'BookFlight' } ] }); app.value('$routerRootComponent', 'app');
  • 15. 15 TYPESCRIPT AND ES 6 Page  36 TypeScriptES 6 ES 5 < ES 6 < TypeScript Page  37 ES 5
  • 16. 16 Controller in ES 6 Page  38 export class FlightSearchController { constructor() { this.from = "Vienna"; this.to = "London"; } search() { […] } select(flight) { […] } } import {FlightSearchController} from './some-file'; var ctrl = new FlightSearchController(); Controller in TypeScript Page  39 export class FlightSearchController { public from: string; public to: string; constructor() { this.from = "Vienna"; this.to = "London"; } public search() { […] } public select() { […] } }
  • 17. 17 Using EcmaScript 6 today Compile to ES5 („Transpilation“) Popular Transpiler: Babel Page  40 Using TypeScript today TypeScript-Compiler compiles TypeScript down to ES6, ES5 oder ES3 Page  41
  • 19. 19 Recap Page  44  controller-as, bindToController, .component  ES6/ TypeScript  Decorators and ngForward  Component Router in AngularJS 1.x Recap Page  45  controller-as, bindToController, .component  ES6/ TypeScript  Decorators and ngForward  Component Router in AngularJS 1.x
  • 20. 20 NGUPGRADE Page  46 ngUpgrade Page  47 FlightCard FlightSvc PassengerCard PassengerSvc FlightList PassengerList App1 1 1 1 2 2 2
  • 21. 21 What do we need? AngularJS 1.x Angular 2 (+ upgrade.js) Page  48 Bootstrapping Page  50 import {upgradeAdapter} from './upgrade-adapter'; // Upgrade, Downgrade upgradeAdapter.bootstrap(document.body, ['app']); Instead of ng-app bzw. angular.bootstrap
  • 23. 23 ngUpgrade Page  54 FlightCard FlightSvc PassengerCard PassengerSvc FlightList PassengerList App1 1 1 1 2 2 2 manfred.steyer@SOFTWAREarchitekt.at SOFTWAREarchitekt.at ManfredSteyer Contact