KEMBAR78
Migration from AngularJS to Angular | PPTX
Migration from AngularJS
to Angular with UI-router
Aleks Zinevych
Front-end Tech Lead
at Datamart inc.
Speaker at
LvivJS conference,
various JS meetups
2https://goo.gl/kZovPa@a_zinewicz @aleksanderzinewicz
3
AngularJS vs Angular
Migration
Demo
Pros and Cons
Agenda
http://www.iconsfind.com/wp-content/uploads/2013/11/Emoticons-Sad.ico 4
AngularJS
https://docs.angularjs.org/guide/databinding 5
Two-way data binding
Model
View
https://larseidnes.com/2014/11/05/angularjs-the-bad-parts/ 6
Problems
Good for small projects
Bad for big projects
7
Universal apps
Server-side
JS
Client-side
JS
Shared JS
8
Server-side rendering
ng1-server
PhantomJS
jsDom
http://www.iconsfind.com/wp-content/uploads/2013/11/Emoticons-Sad.ico
https://thesensitivegut.files.wordpress.com/2017/03/complexitymonster_cropped_web-01.png 9
Hard to learn
https://openclipart.org/download/238687/Boy-asking-question.svg 10
https://cdn.worldvectorlogo.com/logos/angular-3.svg 11
12
Changes
One-way data binding
Server-side rendering
Simplicity
Mobile-oriented
Refactored core
https://gaboesquivel.com/slides/intro-to-angularjs/img/angularjs.jpg 13
VS.
https://auth0.com/blog/more-benchmarks-virtual-dom-vs-angular-12-vs-mithril-js-vs-the-rest/ 14
AngularJS vs. Angular
https://auth0.com/blog/more-benchmarks-virtual-dom-vs-angular-12-vs-mithril-js-vs-the-rest/ 15
AngularJS vs. Angular
16
Migration
http://u-cart.ca/wp-content/uploads/2016/06/stepbystep.jpg 17
https://openclipart.org/download/238687/Boy-asking-question.svg 18
https://blog.nrwl.io/ngupgrade-in-depth-436a52298a00 19
ngUpgrade
https://blog.nrwl.io/ngupgrade-in-depth-436a52298a00 20
ngUpgrade
AngularJS Angular
Component 1
Component 2
Component 1
Component 2
Upgrade
Downgrade
21
Inside Migration
22
Project details
AngularJS 1.5
UI-router < 1.*
Gulp tasks
External dependencies
23
How it worked before?
Url change
UI-Router
State Provider
/Route1
/Route2
/Route3
/Route4
…
Controller1 + View1
Controller2 + View2
Controller3 + View3
Controller4 + View4
24
Preparation
AngularJS
Webpack
UI-router
Yarn
Angular
1.6.4 1.*
Gulp NPM
25
How it’s working now?
Url Change
UI-Router
AngularJS State Provider
/Route1
/Route2
View1 + Controller1
View2 + Controller2
Angular State Provider
/Route3
/Route4
Component3
Component4
https://github.com/zinevych/angular-hybrid-sample 26
Sample App Details
https://github.com/zinevych/angular-hybrid-sample 27
Sample app structure
app
ng1Route
ng1MixedRoute
ng4Route
https://github.com/zinevych/angular-hybrid-sample 28
AngularJS routes
State config
AngularJS Component
https://github.com/zinevych/angular-hybrid-sample 29
Angular routes
State config
Angular Component
https://github.com/zinevych/angular-hybrid-sample 30
How it’s connected?
Angular Bootstrapping
AngularJS Bootstrapping
UI-Router init + Configuration
31
How it’s connected?
32
State object population
AngularJS Angular
https://github.com/zinevych/angular-hybrid-sample 33
AngularJS processing
Url Change
UI-Router
<ui-view />
AngularJS
Component
https://github.com/zinevych/angular-hybrid-sample 34
Angular processing
UIViewNgUpgrade
https://github.com/zinevych/angular-hybrid-sample 35
Angular Components processing
Url Change
UI-Router
<ui-view-ng-upgrade />
Downgrade
Angular
Component
https://github.com/zinevych/angular-hybrid-sample 36
Mixed component processing
UI-router config
AngularJS
https://github.com/zinevych/angular-hybrid-sample 37
Mixed component processing
Angular
https://github.com/zinevych/angular-hybrid-sample 38
Sample App Demo
39
Summary
http://blog.softheme.com/wp-content/uploads/2015/06/fan_rewrite_code.png 40
41
Cons
Speed of development
Performance
Dependencies
Bundle size
42
Pros
Angular
Future-oriented
Mobile-oriented
Better Testability
Modern approaches
43
Contacts
Email: aleksanderzinewicz@gmail.com
Facebook: aleks.zinevych
Twitter: @a_zinewicz
Medium: @aleksanderzinewicz
44
Thank you!
45
Questions?

Migration from AngularJS to Angular

Editor's Notes

  • #3 Починав як дот нет розробник далі груві рубі нода + джс на фронтенді
  • #4 Поговоримо про енгюлар джіес якій його проблеми і що вирішує якраз новий ангуляр
  • #5 Хто не любить ангуляр? Давайте поговоримо про проблеми
  • #6 Коли ми говоримо про ангуляр то відразу в нас все асоціюється з дейта біндінгом
  • #7 Хороший для малих проектів поганий для великих
  • #8 Сьогодні дуже популярними стали юніверсал апи
  • #10 React comparison
  • #11 Як ми знаємо новий англуяр це абсолютно новий фремворк повністю переписнай… так давайте подумаємо чи переписували б вони якби з ним все було ок --- ні, але вони переписали
  • #12 Поговоримо про новий англуяр, внести ясність з неймінгом
  • #14 Щоб не бути голослівним ось бенчмаркінги
  • #27 Семпл апплікейшин з прикладом того як ми це реалізовували в нашому проекті, зараз я би хотів розповісти про нього трохи детальніше, після чого перейдемо до демострації