SlideShare a Scribd company logo
1 of 21
Download to read offline
ng-conf 2015
aka how to move to angular 2.0
The State of Angular 1
Angular 1.4
● New Router
● internationalization
● New ng-animate
● ng-messages — multiple includes, more dynamic
● ng-cookies
○ set path and domain
○ cleans up cookie update process
● 30% faster digest than 1.3
● 2-4% memory footprint improvement
support plan for 1x
● angular.io will be used to gauge traffic on angular 2.0 (vs https://angularjs.org/ and angular 1)
● continue to release until everyone migrates to 2x
Angular 2 Migration Plan
Why migrate?
Angular 2 themes
● flexible, faster, simpler = more productive developers
● angular.io
How is angular 2 different?
● simplification of existing concepts
● integration of new powerful concepts
● productivity enhancements to javascript itself
● AtScript — proposal to extend javascript (es5)
● ES6
● TypeScript
● Annotations
● Integration of Traceur
● View cache -- do not re-render pages already visited
Igor Minar and Brad Green talking about Angular 2 view cache.
Angular 2 Migration Plan
Migration Plan Options
1. big bang plan — load both 1x and 2x libraries
2. incremental — new router supports
a. migrate individual views to 2x
b. rest of the app remains on 1x
Migration Keep in Mind
3. follow best practices on 1x
4. style guide: https://github.com/johnpapa/angular-styleguide
5. https://www.youtube.com/watch?v=hG-ARy0oqjI&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&index=25
6. new router
7. es6 (JavaScript 2015) modules
8. typescript types (optional)
Migration to angular 2 can be top down or bottom up.
Start with one module.
Save most expensive migrations for last.
Angular Router
ngRoute is too simple for modern, complex apps, and for Angular 2, we needed better router.
router design at ng-europe
ngNewRouter
ng-link — creates href
ng-viewport — like ng-view, but can have multiple
lifecycle hooks
● prompts for save/delete
New API for lazy loading!
Uses route-recognizer from EmberJS
github.com/angular/router
angular.github.io/router
Brian Ford explaining the new router
The Shadow DOM
https://www.youtube.com/watch?v=AbunztfV5vU&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&index=6
1.3 web components
● insertion point in shadow dom
● hidden: span.createShadowRoot()
● visible: host.createShadowRoot()
○ host.shadowRoot.innerHTML
● transclude = true — preserves existing template rather than overwriting with template
● manual scope
2.0 component directives
● shadow dom
● sensible default scope — only need name and template
● class & annotation — ES6 class + constructor, annotations
TypeScript and ES6
https://www.youtube.com/watch?v=U7NYTKgkZgo&index=8&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7
What is TypeScript?
● Superset of JavaScript
● Modular
● Scalable application structure
● Strongly typed classes
● Can still use functional approach
● Tooling support
● ES6 standards
https://github.com/seanhess/angularjs-typescript
https://github.com/danwahlin
Bindings
Angular 2
two kinds of bindings:
1. literal
2. expressions
Why [property] not {{expression}}
Always write to attributes, not properties
[properties]=“expression”
unneeded directives (about 20) == because they are available in HTML
explicit templates
<template foreach #item [in]=“items”></template>
simpler, predictable, toolable
shadow dom out of the box
Angular 2 binds to properties, not attributes.
Lazy Loading
divide code into modules
placeholder route for each lazy-loaded path
new injector that forwards whitelisted lazy loaded changes
register real routes
route.reload()
Until Angular 2 lazy load is ready, ocLazyLoad:
https://github.com/ocombe/ocLazyLoad

More Related Content

What's hot

About order form improvements
About order form improvementsAbout order form improvements
About order form improvementsGengo
 
Get started with Kubernetes on GKE
Get started with Kubernetes on GKEGet started with Kubernetes on GKE
Get started with Kubernetes on GKEZachary Russell
 
About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)Igalia
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupIftach Schonbaum
 
erlang.pl demo day, 2 August 2017
erlang.pl demo day, 2 August 2017erlang.pl demo day, 2 August 2017
erlang.pl demo day, 2 August 2017Kacper Mentel
 
KDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsKDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsMarco Martin
 
News from Git in Java Land
News from Git in Java LandNews from Git in Java Land
News from Git in Java Landmsohn
 
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)Igalia
 
Azure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutesAzure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutesAlessandro Melchiori
 
Ewebkit basic (Web rendering enging of EFL)
Ewebkit basic (Web rendering enging of EFL)Ewebkit basic (Web rendering enging of EFL)
Ewebkit basic (Web rendering enging of EFL)ryuan choi
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...Igalia
 
EGit 3.0 and beyond
EGit 3.0 and beyondEGit 3.0 and beyond
EGit 3.0 and beyondmsohn
 
Part 3 Docker Concepts - Kitematic
Part 3 Docker Concepts - KitematicPart 3 Docker Concepts - Kitematic
Part 3 Docker Concepts - KitematicBiswajit De
 
Green Custard Friday Talk 22: Flutter
Green Custard Friday Talk 22: FlutterGreen Custard Friday Talk 22: Flutter
Green Custard Friday Talk 22: FlutterGreen Custard
 

What's hot (18)

About order form improvements
About order form improvementsAbout order form improvements
About order form improvements
 
Get started with Kubernetes on GKE
Get started with Kubernetes on GKEGet started with Kubernetes on GKE
Get started with Kubernetes on GKE
 
Angular intro
Angular introAngular intro
Angular intro
 
Docker off the grid
Docker off the gridDocker off the grid
Docker off the grid
 
About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)About OpenGL and Vulkan interoperability (XDC 2020)
About OpenGL and Vulkan interoperability (XDC 2020)
 
Google Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive MeetupGoogle Kubernetes Engine Deep Dive Meetup
Google Kubernetes Engine Deep Dive Meetup
 
erlang.pl demo day, 2 August 2017
erlang.pl demo day, 2 August 2017erlang.pl demo day, 2 August 2017
erlang.pl demo day, 2 August 2017
 
KDE 4.1 Plasma widgets
KDE 4.1 Plasma widgetsKDE 4.1 Plasma widgets
KDE 4.1 Plasma widgets
 
News from Git in Java Land
News from Git in Java LandNews from Git in Java Land
News from Git in Java Land
 
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
Maximize The Performance of HTML5 Video in RPI2 (Embedded Linux Conference 2016)
 
Rails in docker
Rails in dockerRails in docker
Rails in docker
 
Azure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutesAzure functions: from a function to a whole application in 60 minutes
Azure functions: from a function to a whole application in 60 minutes
 
Ewebkit basic (Web rendering enging of EFL)
Ewebkit basic (Web rendering enging of EFL)Ewebkit basic (Web rendering enging of EFL)
Ewebkit basic (Web rendering enging of EFL)
 
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
HTML5 Apps on AGL Platform with the Web Application Manager (Automotive Grade...
 
EGit 3.0 and beyond
EGit 3.0 and beyondEGit 3.0 and beyond
EGit 3.0 and beyond
 
Docker. General overview
Docker. General overviewDocker. General overview
Docker. General overview
 
Part 3 Docker Concepts - Kitematic
Part 3 Docker Concepts - KitematicPart 3 Docker Concepts - Kitematic
Part 3 Docker Concepts - Kitematic
 
Green Custard Friday Talk 22: Flutter
Green Custard Friday Talk 22: FlutterGreen Custard Friday Talk 22: Flutter
Green Custard Friday Talk 22: Flutter
 

Viewers also liked

1.6 _Important element required to complete a building
1.6  _Important element required to complete a building1.6  _Important element required to complete a building
1.6 _Important element required to complete a buildingTeow Beng Hur
 
Latihan7_Rani
Latihan7_RaniLatihan7_Rani
Latihan7_Raniranioke12
 
Installation Sequence Presentation
Installation Sequence PresentationInstallation Sequence Presentation
Installation Sequence PresentationTeow Beng Hur
 
Velocity_Conference
Velocity_ConferenceVelocity_Conference
Velocity_ConferenceAnne Cypcar
 
HC PRECAST SYSTEM's Technical Property
HC PRECAST SYSTEM's Technical PropertyHC PRECAST SYSTEM's Technical Property
HC PRECAST SYSTEM's Technical PropertyTeow Beng Hur
 
IBS is a system not a machine
IBS is a system not a machineIBS is a system not a machine
IBS is a system not a machineTeow Beng Hur
 
Gallery Superstructure (Frame & Wall) 2016
Gallery Superstructure  (Frame & Wall) 2016Gallery Superstructure  (Frame & Wall) 2016
Gallery Superstructure (Frame & Wall) 2016Teow Beng Hur
 
First Single-storey Bungalow Project after 9 years since 2008.
First Single-storey Bungalow Project after 9 years since 2008.First Single-storey Bungalow Project after 9 years since 2008.
First Single-storey Bungalow Project after 9 years since 2008.Teow Beng Hur
 

Viewers also liked (12)

1.6 _Important element required to complete a building
1.6  _Important element required to complete a building1.6  _Important element required to complete a building
1.6 _Important element required to complete a building
 
Last vacation
Last vacationLast vacation
Last vacation
 
Tcm
TcmTcm
Tcm
 
Latihan7_Rani
Latihan7_RaniLatihan7_Rani
Latihan7_Rani
 
Installation Sequence Presentation
Installation Sequence PresentationInstallation Sequence Presentation
Installation Sequence Presentation
 
Velocity_Conference
Velocity_ConferenceVelocity_Conference
Velocity_Conference
 
HC PRECAST SYSTEM's Technical Property
HC PRECAST SYSTEM's Technical PropertyHC PRECAST SYSTEM's Technical Property
HC PRECAST SYSTEM's Technical Property
 
IBS is a system not a machine
IBS is a system not a machineIBS is a system not a machine
IBS is a system not a machine
 
Presentation 2016
Presentation  2016Presentation  2016
Presentation 2016
 
Gallery Superstructure (Frame & Wall) 2016
Gallery Superstructure  (Frame & Wall) 2016Gallery Superstructure  (Frame & Wall) 2016
Gallery Superstructure (Frame & Wall) 2016
 
First Single-storey Bungalow Project after 9 years since 2008.
First Single-storey Bungalow Project after 9 years since 2008.First Single-storey Bungalow Project after 9 years since 2008.
First Single-storey Bungalow Project after 9 years since 2008.
 
Pak china Gwadar
Pak china GwadarPak china Gwadar
Pak china Gwadar
 

Similar to ngconf2015

New power of Angular2 Router
New power of Angular2 RouterNew power of Angular2 Router
New power of Angular2 RouterZhentian Wan
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Bruce Pentreath
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2Kaxil Naik
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenchesJohannes Rudolph
 
Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thWong Hoi Sing Edison
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0Carlo Bonamico
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraLINAGORA
 
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]Alex Ershov
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2Knoldus Inc.
 
Best episode ever: Angular 2 from the perspective of an Angular 1 developer
Best episode ever: Angular 2 from the perspective of an Angular 1 developerBest episode ever: Angular 2 from the perspective of an Angular 1 developer
Best episode ever: Angular 2 from the perspective of an Angular 1 developerPeter Bouda
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...Igalia
 
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupWhat's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupKaxil Naik
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hoodGuido Stevens
 
Sprint 140
Sprint 140Sprint 140
Sprint 140ManageIQ
 

Similar to ngconf2015 (20)

New power of Angular2 Router
New power of Angular2 RouterNew power of Angular2 Router
New power of Angular2 Router
 
Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3Angular JS 2_0 BCS CTO_in_Res V3
Angular JS 2_0 BCS CTO_in_Res V3
 
El viaje de Angular1 a Angular2
El viaje de Angular1 a Angular2El viaje de Angular1 a Angular2
El viaje de Angular1 a Angular2
 
5 Key Benefits of Migration
5 Key Benefits of Migration5 Key Benefits of Migration
5 Key Benefits of Migration
 
Upcoming features in Airflow 2
Upcoming features in Airflow 2Upcoming features in Airflow 2
Upcoming features in Airflow 2
 
Angular2 - A story from the trenches
Angular2 - A story from the trenchesAngular2 - A story from the trenches
Angular2 - A story from the trenches
 
Getting to Angular 2
Getting to Angular 2Getting to Angular 2
Getting to Angular 2
 
Hong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8thHong Kong Drupal User Group - 2014 March 8th
Hong Kong Drupal User Group - 2014 March 8th
 
Angular 2
Angular 2Angular 2
Angular 2
 
Angular 1.x reloaded: improve your app now! and get ready for 2.0
Angular 1.x reloaded:  improve your app now! and get ready for 2.0Angular 1.x reloaded:  improve your app now! and get ready for 2.0
Angular 1.x reloaded: improve your app now! and get ready for 2.0
 
Angular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - LinagoraAngular (v2 and up) - Morning to understand - Linagora
Angular (v2 and up) - Morning to understand - Linagora
 
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]26 top angular 8 interview questions to know in 2020   [www.full stack.cafe]
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
 
Angular 2.0
Angular 2.0Angular 2.0
Angular 2.0
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
Best episode ever: Angular 2 from the perspective of an Angular 1 developer
Best episode ever: Angular 2 from the perspective of an Angular 1 developerBest episode ever: Angular 2 from the perspective of an Angular 1 developer
Best episode ever: Angular 2 from the perspective of an Angular 1 developer
 
Hot deploy
Hot deployHot deploy
Hot deploy
 
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
A Browser for the Automotive: Introduction to WebKit for Wayland (Automotive ...
 
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow MeetupWhat's coming in Airflow 2.0? - NYC Apache Airflow Meetup
What's coming in Airflow 2.0? - NYC Apache Airflow Meetup
 
Plone Intranet under the hood
Plone Intranet under the hoodPlone Intranet under the hood
Plone Intranet under the hood
 
Sprint 140
Sprint 140Sprint 140
Sprint 140
 

ngconf2015

  • 1. ng-conf 2015 aka how to move to angular 2.0
  • 2. The State of Angular 1 Angular 1.4 ● New Router ● internationalization ● New ng-animate ● ng-messages — multiple includes, more dynamic ● ng-cookies ○ set path and domain ○ cleans up cookie update process ● 30% faster digest than 1.3 ● 2-4% memory footprint improvement support plan for 1x ● angular.io will be used to gauge traffic on angular 2.0 (vs https://angularjs.org/ and angular 1) ● continue to release until everyone migrates to 2x
  • 3. Angular 2 Migration Plan Why migrate? Angular 2 themes ● flexible, faster, simpler = more productive developers ● angular.io How is angular 2 different? ● simplification of existing concepts ● integration of new powerful concepts ● productivity enhancements to javascript itself ● AtScript — proposal to extend javascript (es5) ● ES6 ● TypeScript ● Annotations ● Integration of Traceur ● View cache -- do not re-render pages already visited
  • 4. Igor Minar and Brad Green talking about Angular 2 view cache.
  • 5. Angular 2 Migration Plan Migration Plan Options 1. big bang plan — load both 1x and 2x libraries 2. incremental — new router supports a. migrate individual views to 2x b. rest of the app remains on 1x Migration Keep in Mind 3. follow best practices on 1x 4. style guide: https://github.com/johnpapa/angular-styleguide 5. https://www.youtube.com/watch?v=hG-ARy0oqjI&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&index=25 6. new router 7. es6 (JavaScript 2015) modules 8. typescript types (optional)
  • 6. Migration to angular 2 can be top down or bottom up.
  • 7. Start with one module.
  • 8. Save most expensive migrations for last.
  • 9. Angular Router ngRoute is too simple for modern, complex apps, and for Angular 2, we needed better router. router design at ng-europe ngNewRouter ng-link — creates href ng-viewport — like ng-view, but can have multiple lifecycle hooks ● prompts for save/delete New API for lazy loading! Uses route-recognizer from EmberJS github.com/angular/router angular.github.io/router
  • 10. Brian Ford explaining the new router
  • 11. The Shadow DOM https://www.youtube.com/watch?v=AbunztfV5vU&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7&index=6 1.3 web components ● insertion point in shadow dom ● hidden: span.createShadowRoot() ● visible: host.createShadowRoot() ○ host.shadowRoot.innerHTML ● transclude = true — preserves existing template rather than overwriting with template ● manual scope 2.0 component directives ● shadow dom ● sensible default scope — only need name and template ● class & annotation — ES6 class + constructor, annotations
  • 12. TypeScript and ES6 https://www.youtube.com/watch?v=U7NYTKgkZgo&index=8&list=PLOETEcp3DkCoNnlhE-7fovYvqwVPrRiY7 What is TypeScript? ● Superset of JavaScript ● Modular ● Scalable application structure ● Strongly typed classes ● Can still use functional approach ● Tooling support ● ES6 standards https://github.com/seanhess/angularjs-typescript https://github.com/danwahlin
  • 13. Bindings Angular 2 two kinds of bindings: 1. literal 2. expressions Why [property] not {{expression}} Always write to attributes, not properties [properties]=“expression” unneeded directives (about 20) == because they are available in HTML explicit templates <template foreach #item [in]=“items”></template> simpler, predictable, toolable shadow dom out of the box
  • 14.
  • 15.
  • 16. Angular 2 binds to properties, not attributes.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Lazy Loading divide code into modules placeholder route for each lazy-loaded path new injector that forwards whitelisted lazy loaded changes register real routes route.reload() Until Angular 2 lazy load is ready, ocLazyLoad: https://github.com/ocombe/ocLazyLoad