SlideShare ist ein Scribd-Unternehmen logo
1 von 68
a traveler's diary
By Shavit Cohen
2
April 3, 2016
angular 2 - a traveler's diary by Shavit Cohen
Shavit Cohen
shavit@tikalk.com
About me in a Nutshell...
FullStack Developer for 7.5 years
Angular.js Consultant, currently at HP
JS Team Lead at Tikal
Learning Experience Enthusiastic
angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen
Myself :) And my journey with Angular
MyLove - Hate Relationshipwith Angular 2
Angular1 vs Angular2 - Code Comparison
Practical Tips for the Angular 2 wannabes
What will I talk about ?
Angular 2 Syntaxintro
4
Practical Tips
Code Comparison
The Different Syntax
Me & Angular :)
angular 2 - a traveler's diary by Shavit Cohen
Me, Myself and Angular1.x
Hybrid mobile app
Being compiled with Phonegap
Still used worldwide :)
A lot of mistakes while developing
6
I Misused Angular as a framework
7angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen
So, looking back, Angular 1 experience felt like...
Frustration
level
Time
2 direction binding is Cool
ng-repeat is awesome
logic within the html markup is strange
Directives ? WTF is this syntax
What is Transclude ?
Directives - What does scope
chars (=,&,@) means ?
Directives - Why using
scope without a $
Services are helpful :)
Provider?
Factory?
Constant?
Values?
Why do we need
so many ?@#
I’ll just use a
service :)
Why there are so many
ways to do simple stuff
Why do I have to do $apply
for the view to render
The $digest loop
is killing the CPU
UI Router is
nice and helpful
Switching to UI
Router is a pain
Performance
issues again
John Papa
code styling
guide is
awesome
Why
Just
Now?!
But after the frustration was over
9angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen
We made peace with Angular
We love it (Most of us)
Understand it
Knows it’s flaws but lives with them
10
And then They announced
11angular 2 - a traveler's diary by Shavit Cohen
12angular 2 - a traveler's diary by Shavit Cohen
2
angular 2 - a traveler's diary by Shavit Cohen 13
angular 2 - a traveler's diary by Shavit Cohen
Labor Pains
14
angular 2 - a traveler's diary by Shavit Cohen
Labor Pains
Documentation is missing
15
angular 2 - a traveler's diary by Shavit Cohen
Labor pains
Only limited best practices which based on limited experience
https://github.com/mgechev/angular2-style-guide
16
angular 2 - a traveler's diary by Shavit Cohen
Labor pains
Lots of outdated learning materials
17
Outdated syntax
From: angular-tips.com
It’s look like the worst time ever for
getting into Angular2
18angular 2 - a traveler's diary by Shavit Cohen
So...
19angular 2 - a traveler's diary by Shavit Cohen
Iv’e decided to take it for a spin
20angular 2 - a traveler's diary by Shavit Cohen
I thought of an idea that can provide developers a
richer learning experience via videos
21angular 2 - a traveler's diary by Shavit Cohen
2
I will share my Idea
Practical Tips
Code Comparison
The Different Syntax
Me & Angular :)
angular 2 - a traveler's diary by Shavit Cohen
2
23
We want to get into Angular 2
But Then we see something that looks like this
angular 2 - a traveler's diary by Shavit Cohen
2
24
angular 2 - a traveler's diary by Shavit Cohen 25
Let’s clarify
extends
extends
So why not Angular2 with ES5 ?
With no unfamiliar syntax
26angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen
Angular 2 with TypeScript Angular 2 with ES5
27
angular 2 - a traveler's diary by Shavit Cohen 28
angular 2 - a traveler's diary by Shavit Cohen
Let’s conclude so far
Angular 1 syntax !== Angular 2 syntax
29
Coding Angular 2 with ES5 is doable
Angular 2 is experiencing labor pains
“prepare your code for Angular 2” probably won’t help much
But only little documentation about it is currently available
Practical Tips
Code Comparison
The Syntax
Me & Angular :)
angular 2 - a traveler's diary by Shavit Cohen 31
2
Watchers
Vs
Change Detection
angular 2 - a traveler's diary by Shavit Cohen
Watchers Change Detection - “Unidirectional Data Flow”
32
1
2
Watchers vs Change Detection
angular 2 - a traveler's diary by Shavit Cohen 33
2
Controllers, and
Directives
Vs
Class
angular 2 - a traveler's diary by Shavit Cohen 34
1
Controllers And Directives Vs Class
angular 2 - a traveler's diary by Shavit Cohen 35
2
Controllers And Directives Vs Class
angular 2 - a traveler's diary by Shavit Cohen 36
21
Controllers And Directives Vs Class
angular 2 - a traveler's diary by Shavit Cohen 37
1
Controllers And Directives Vs Class
angular 2 - a traveler's diary by Shavit Cohen 38
Controllers And Directive Vs Class
2
angular 2 - a traveler's diary by Shavit Cohen 39
1
Controllers And Directive Vs Class
2
<body> may look:
angular 2 - a traveler's diary by Shavit Cohen 40
Services
[registering a service]2
angular 2 - a traveler's diary by Shavit Cohen 41
Services
[Injecting a service]2
angular 2 - a traveler's diary by Shavit Cohen 42
2
Markup
angular 2 - a traveler's diary by Shavit Cohen 43
1
Markup
2
ng-if vs *ngIf
angular 2 - a traveler's diary by Shavit Cohen 44
1
2
ng-repeat vs *ngFor
Markup
angular 2 - a traveler's diary by Shavit Cohen 45
1
2
ng-show vs [hidden]
Markup
angular 2 - a traveler's diary by Shavit Cohen 46
2
Using [Element DOM attribute]
Markup
angular 2 - a traveler's diary by Shavit Cohen 47
1
2
ng-class vs [ngClass]
Markup
angular 2 - a traveler's diary by Shavit Cohen 48
1
2
ng-[event] vs (event)
Markup
angular 2 - a traveler's diary by Shavit Cohen 49
2
ng-[event] vs (event)
Markup
angular 2 - a traveler's diary by Shavit Cohen 50
1
2
2 Direction Binding
Markup
angular 2 - a traveler's diary by Shavit Cohen 51
2
Bootstrapping
angular 2 - a traveler's diary by Shavit Cohen 52
1
2
App bootstrapping
Markup
myApp.cmp.ts
main.cmp.ts
angular 2 - a traveler's diary by Shavit Cohen
Summarizing - main changes
• Markup:
▪ “Directive” oriented markup.
▪ The use of # (for local template variable).
▪ The use of * when items are being added / removed from the DOM.
▪ The binding are different [DOM property / directive], (event),
[(ngModel)]
53
angular 2 - a traveler's diary by Shavit Cohen
Summarizing - main changes
• Code
▪ Unidirectional data-flow approach
▪ Everything is a class
▪ Dependency injection via the constructor
54
Back to me
angular 2 - a traveler's diary by Shavit Cohen
I Learned 3 major things
Angular 1 !== Angular 2
56
Coding with TypeScript can be fun and reduce bugs
Visual Studio Code is a kick ass IDE
angular 2 - a traveler's diary by Shavit Cohen
Now this is how Angular 2 feels like
Frustration
level
Time
It plays well with 3rd
party libraries
It not So bad
Ok, I got it but I don’t like it!
WTF is this syntax
OMG, I hate
TypeScript! Why is the development so slow?
What are these bindings attributes? is this a
valid HTML ?
The router concept is nice
No more $apply
OMG, I love
TypeScript!
Practical Tips
Code Comparison
The Syntax
Me & Angular :)
angular 2 - a traveler's diary by Shavit Cohen
Dive in - Build a small app from scratch
59angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen
Avoid Copy & Paste
Really,
Avoid it. Type everything (which
is new to you) yourself, it will
help you feel comfortable
faster.
60angular 2 - a traveler's diary by Shavit Cohen
angular 2 - a traveler's diary by Shavit Cohen 61
Know The DOM
angular 2 - a traveler's diary by Shavit Cohen
Since Events and Dom attributes are being binded
Natively
angular 2 - a traveler's diary by Shavit Cohen 62
Use Arrow Functions
angular 2 - a traveler's diary by Shavit Cohen
In a ES2015 class you are working with this. Anonymous
functions might make you to loose the current scope.
angular 2 - a traveler's diary by Shavit Cohen 63angular 2 - a traveler's diary by Shavit Cohen
Embrace TypeScript
angular 2 - a traveler's diary by Shavit Cohen 64angular 2 - a traveler's diary by Shavit Cohen
Notice the difference
That’s it (almost)
65angular 2 - a traveler's diary by Shavit Cohen
Why now ?
66angular 2 - a traveler's diary by Shavit Cohen
2
Thanks.
angular 2 - a traveler's diary by Shavit Cohen
Sources
Thinking in Angular 2.0
Angular 2 documentation
Change Detection Reinvented Victor Savkin
PluralSight Course by John Papa - Angular 2.0 First Look
Get 6 months of PluralSight for free
68

Weitere ähnliche Inhalte

Andere mochten auch

Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next FrameworkCommit University
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronLukas Ruebbelke
 
Angular js 2
Angular js 2Angular js 2
Angular js 2Ran Wahle
 
An afternoon with angular 2
An afternoon with angular 2An afternoon with angular 2
An afternoon with angular 2Mike Melusky
 
The evolution of Angular 2 @ AngularJS Munich Meetup #5
The evolution of Angular 2 @ AngularJS Munich Meetup #5The evolution of Angular 2 @ AngularJS Munich Meetup #5
The evolution of Angular 2 @ AngularJS Munich Meetup #5Johannes Weber
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Codemotion
 
Tech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new frameworkTech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new frameworkCodemotion
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java DevelopersYakov Fain
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2FITC
 

Andere mochten auch (10)

Angular 2 - The Next Framework
Angular 2 - The Next FrameworkAngular 2 - The Next Framework
Angular 2 - The Next Framework
 
Get that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and ElectronGet that Corner Office with Angular 2 and Electron
Get that Corner Office with Angular 2 and Electron
 
Angular js 2
Angular js 2Angular js 2
Angular js 2
 
An afternoon with angular 2
An afternoon with angular 2An afternoon with angular 2
An afternoon with angular 2
 
Angular 2
Angular 2Angular 2
Angular 2
 
The evolution of Angular 2 @ AngularJS Munich Meetup #5
The evolution of Angular 2 @ AngularJS Munich Meetup #5The evolution of Angular 2 @ AngularJS Munich Meetup #5
The evolution of Angular 2 @ AngularJS Munich Meetup #5
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
 
Tech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new frameworkTech Webinar: Angular 2, Introduction to a new framework
Tech Webinar: Angular 2, Introduction to a new framework
 
Angular 2 for Java Developers
Angular 2 for Java DevelopersAngular 2 for Java Developers
Angular 2 for Java Developers
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2
 

Ähnlich wie Angular 2 a traveler's diary

AngularConf2016 - A leap of faith !?
AngularConf2016 - A leap of faith !?AngularConf2016 - A leap of faith !?
AngularConf2016 - A leap of faith !?Alessandro Giorgetti
 
Adventures with Angular 2
Adventures with Angular 2Adventures with Angular 2
Adventures with Angular 2Dragos Ionita
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Nisheed Jagadish
 
Angular 2 release final
Angular 2   release finalAngular 2   release final
Angular 2 release finalAndres Ciceri
 
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...Tracy Lee
 
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016Tatiane Aguirres Nogueira
 
Realizzare Single Page Application con Angular2
Realizzare Single Page Application con Angular2Realizzare Single Page Application con Angular2
Realizzare Single Page Application con Angular2Michele Aponte
 
Angular 2 : le réveil de la force
Angular 2 : le réveil de la forceAngular 2 : le réveil de la force
Angular 2 : le réveil de la forceNicolas PENNEC
 
Microsoft TechDays 2016 in Baden
Microsoft TechDays 2016 in BadenMicrosoft TechDays 2016 in Baden
Microsoft TechDays 2016 in BadenFabian Gosebrink
 
Angular 2 - How we got here?
Angular 2 - How we got here?Angular 2 - How we got here?
Angular 2 - How we got here?Marios Fakiolas
 
Getting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIGetting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIJim Lynch
 
Creating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignCreating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignTracy Lee
 
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례Hwanhee Kim
 
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
 
Fitc 2012 - rise of the modules
Fitc 2012 - rise of the modulesFitc 2012 - rise of the modules
Fitc 2012 - rise of the modulestschneidereit
 
Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까장현 한
 

Ähnlich wie Angular 2 a traveler's diary (20)

AngularConf2016 - A leap of faith !?
AngularConf2016 - A leap of faith !?AngularConf2016 - A leap of faith !?
AngularConf2016 - A leap of faith !?
 
Angular2 on stage
Angular2 on stageAngular2 on stage
Angular2 on stage
 
Adventures with Angular 2
Adventures with Angular 2Adventures with Angular 2
Adventures with Angular 2
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0
 
Angular 2 release final
Angular 2   release finalAngular 2   release final
Angular 2 release final
 
Angular
AngularAngular
Angular
 
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
AngularJS RTP Slides - Angular 2 Demo #ngtattoo with Angular CLI, Newest New ...
 
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016
Palestra "Ionic Framework 2 - O que vem por aí?" TDC 2016
 
Realizzare Single Page Application con Angular2
Realizzare Single Page Application con Angular2Realizzare Single Page Application con Angular2
Realizzare Single Page Application con Angular2
 
Angular 2 : le réveil de la force
Angular 2 : le réveil de la forceAngular 2 : le réveil de la force
Angular 2 : le réveil de la force
 
Microsoft TechDays 2016 in Baden
Microsoft TechDays 2016 in BadenMicrosoft TechDays 2016 in Baden
Microsoft TechDays 2016 in Baden
 
Angular 2 - How we got here?
Angular 2 - How we got here?Angular 2 - How we got here?
Angular 2 - How we got here?
 
Getting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLIGetting Started with the Angular 2 CLI
Getting Started with the Angular 2 CLI
 
El viaje de Angular1 a Angular2
El viaje de Angular1 a Angular2El viaje de Angular1 a Angular2
El viaje de Angular1 a Angular2
 
Creating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material DesignCreating BananaJS with Angular 2, Angular CLI, and Material Design
Creating BananaJS with Angular 2, Angular CLI, and Material Design
 
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례
[NDC2017] 딥러닝으로 게임 콘텐츠 제작하기 - VAE를 이용한 콘텐츠 생성 기법 연구 사례
 
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")
 
Fitc 2012 - rise of the modules
Fitc 2012 - rise of the modulesFitc 2012 - rise of the modules
Fitc 2012 - rise of the modules
 
Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까Angular 2 어디까지 왔을까
Angular 2 어디까지 왔을까
 
Ionic 2 - O que mudou?
Ionic 2 - O que mudou?Ionic 2 - O que mudou?
Ionic 2 - O que mudou?
 

Kürzlich hochgeladen

computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxsomshekarkn64
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 

Kürzlich hochgeladen (20)

computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
lifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptxlifi-technology with integration of IOT.pptx
lifi-technology with integration of IOT.pptx
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 

Angular 2 a traveler's diary

  • 1. a traveler's diary By Shavit Cohen 2 April 3, 2016
  • 2. angular 2 - a traveler's diary by Shavit Cohen Shavit Cohen shavit@tikalk.com About me in a Nutshell... FullStack Developer for 7.5 years Angular.js Consultant, currently at HP JS Team Lead at Tikal Learning Experience Enthusiastic
  • 3. angular 2 - a traveler's diary by Shavit Cohen
  • 4. angular 2 - a traveler's diary by Shavit Cohen Myself :) And my journey with Angular MyLove - Hate Relationshipwith Angular 2 Angular1 vs Angular2 - Code Comparison Practical Tips for the Angular 2 wannabes What will I talk about ? Angular 2 Syntaxintro 4
  • 5. Practical Tips Code Comparison The Different Syntax Me & Angular :)
  • 6. angular 2 - a traveler's diary by Shavit Cohen Me, Myself and Angular1.x Hybrid mobile app Being compiled with Phonegap Still used worldwide :) A lot of mistakes while developing 6
  • 7. I Misused Angular as a framework 7angular 2 - a traveler's diary by Shavit Cohen
  • 8. angular 2 - a traveler's diary by Shavit Cohen So, looking back, Angular 1 experience felt like... Frustration level Time 2 direction binding is Cool ng-repeat is awesome logic within the html markup is strange Directives ? WTF is this syntax What is Transclude ? Directives - What does scope chars (=,&,@) means ? Directives - Why using scope without a $ Services are helpful :) Provider? Factory? Constant? Values? Why do we need so many ?@# I’ll just use a service :) Why there are so many ways to do simple stuff Why do I have to do $apply for the view to render The $digest loop is killing the CPU UI Router is nice and helpful Switching to UI Router is a pain Performance issues again John Papa code styling guide is awesome Why Just Now?!
  • 9. But after the frustration was over 9angular 2 - a traveler's diary by Shavit Cohen
  • 10. angular 2 - a traveler's diary by Shavit Cohen We made peace with Angular We love it (Most of us) Understand it Knows it’s flaws but lives with them 10
  • 11. And then They announced 11angular 2 - a traveler's diary by Shavit Cohen
  • 12. 12angular 2 - a traveler's diary by Shavit Cohen 2
  • 13. angular 2 - a traveler's diary by Shavit Cohen 13
  • 14. angular 2 - a traveler's diary by Shavit Cohen Labor Pains 14
  • 15. angular 2 - a traveler's diary by Shavit Cohen Labor Pains Documentation is missing 15
  • 16. angular 2 - a traveler's diary by Shavit Cohen Labor pains Only limited best practices which based on limited experience https://github.com/mgechev/angular2-style-guide 16
  • 17. angular 2 - a traveler's diary by Shavit Cohen Labor pains Lots of outdated learning materials 17 Outdated syntax From: angular-tips.com
  • 18. It’s look like the worst time ever for getting into Angular2 18angular 2 - a traveler's diary by Shavit Cohen
  • 19. So... 19angular 2 - a traveler's diary by Shavit Cohen
  • 20. Iv’e decided to take it for a spin 20angular 2 - a traveler's diary by Shavit Cohen
  • 21. I thought of an idea that can provide developers a richer learning experience via videos 21angular 2 - a traveler's diary by Shavit Cohen 2 I will share my Idea
  • 22. Practical Tips Code Comparison The Different Syntax Me & Angular :)
  • 23. angular 2 - a traveler's diary by Shavit Cohen 2 23 We want to get into Angular 2 But Then we see something that looks like this
  • 24. angular 2 - a traveler's diary by Shavit Cohen 2 24
  • 25. angular 2 - a traveler's diary by Shavit Cohen 25 Let’s clarify extends extends
  • 26. So why not Angular2 with ES5 ? With no unfamiliar syntax 26angular 2 - a traveler's diary by Shavit Cohen
  • 27. angular 2 - a traveler's diary by Shavit Cohen Angular 2 with TypeScript Angular 2 with ES5 27
  • 28. angular 2 - a traveler's diary by Shavit Cohen 28
  • 29. angular 2 - a traveler's diary by Shavit Cohen Let’s conclude so far Angular 1 syntax !== Angular 2 syntax 29 Coding Angular 2 with ES5 is doable Angular 2 is experiencing labor pains “prepare your code for Angular 2” probably won’t help much But only little documentation about it is currently available
  • 30. Practical Tips Code Comparison The Syntax Me & Angular :)
  • 31. angular 2 - a traveler's diary by Shavit Cohen 31 2 Watchers Vs Change Detection
  • 32. angular 2 - a traveler's diary by Shavit Cohen Watchers Change Detection - “Unidirectional Data Flow” 32 1 2 Watchers vs Change Detection
  • 33. angular 2 - a traveler's diary by Shavit Cohen 33 2 Controllers, and Directives Vs Class
  • 34. angular 2 - a traveler's diary by Shavit Cohen 34 1 Controllers And Directives Vs Class
  • 35. angular 2 - a traveler's diary by Shavit Cohen 35 2 Controllers And Directives Vs Class
  • 36. angular 2 - a traveler's diary by Shavit Cohen 36 21 Controllers And Directives Vs Class
  • 37. angular 2 - a traveler's diary by Shavit Cohen 37 1 Controllers And Directives Vs Class
  • 38. angular 2 - a traveler's diary by Shavit Cohen 38 Controllers And Directive Vs Class 2
  • 39. angular 2 - a traveler's diary by Shavit Cohen 39 1 Controllers And Directive Vs Class 2 <body> may look:
  • 40. angular 2 - a traveler's diary by Shavit Cohen 40 Services [registering a service]2
  • 41. angular 2 - a traveler's diary by Shavit Cohen 41 Services [Injecting a service]2
  • 42. angular 2 - a traveler's diary by Shavit Cohen 42 2 Markup
  • 43. angular 2 - a traveler's diary by Shavit Cohen 43 1 Markup 2 ng-if vs *ngIf
  • 44. angular 2 - a traveler's diary by Shavit Cohen 44 1 2 ng-repeat vs *ngFor Markup
  • 45. angular 2 - a traveler's diary by Shavit Cohen 45 1 2 ng-show vs [hidden] Markup
  • 46. angular 2 - a traveler's diary by Shavit Cohen 46 2 Using [Element DOM attribute] Markup
  • 47. angular 2 - a traveler's diary by Shavit Cohen 47 1 2 ng-class vs [ngClass] Markup
  • 48. angular 2 - a traveler's diary by Shavit Cohen 48 1 2 ng-[event] vs (event) Markup
  • 49. angular 2 - a traveler's diary by Shavit Cohen 49 2 ng-[event] vs (event) Markup
  • 50. angular 2 - a traveler's diary by Shavit Cohen 50 1 2 2 Direction Binding Markup
  • 51. angular 2 - a traveler's diary by Shavit Cohen 51 2 Bootstrapping
  • 52. angular 2 - a traveler's diary by Shavit Cohen 52 1 2 App bootstrapping Markup myApp.cmp.ts main.cmp.ts
  • 53. angular 2 - a traveler's diary by Shavit Cohen Summarizing - main changes • Markup: ▪ “Directive” oriented markup. ▪ The use of # (for local template variable). ▪ The use of * when items are being added / removed from the DOM. ▪ The binding are different [DOM property / directive], (event), [(ngModel)] 53
  • 54. angular 2 - a traveler's diary by Shavit Cohen Summarizing - main changes • Code ▪ Unidirectional data-flow approach ▪ Everything is a class ▪ Dependency injection via the constructor 54
  • 56. angular 2 - a traveler's diary by Shavit Cohen I Learned 3 major things Angular 1 !== Angular 2 56 Coding with TypeScript can be fun and reduce bugs Visual Studio Code is a kick ass IDE
  • 57. angular 2 - a traveler's diary by Shavit Cohen Now this is how Angular 2 feels like Frustration level Time It plays well with 3rd party libraries It not So bad Ok, I got it but I don’t like it! WTF is this syntax OMG, I hate TypeScript! Why is the development so slow? What are these bindings attributes? is this a valid HTML ? The router concept is nice No more $apply OMG, I love TypeScript!
  • 58. Practical Tips Code Comparison The Syntax Me & Angular :)
  • 59. angular 2 - a traveler's diary by Shavit Cohen Dive in - Build a small app from scratch 59angular 2 - a traveler's diary by Shavit Cohen
  • 60. angular 2 - a traveler's diary by Shavit Cohen Avoid Copy & Paste Really, Avoid it. Type everything (which is new to you) yourself, it will help you feel comfortable faster. 60angular 2 - a traveler's diary by Shavit Cohen
  • 61. angular 2 - a traveler's diary by Shavit Cohen 61 Know The DOM angular 2 - a traveler's diary by Shavit Cohen Since Events and Dom attributes are being binded Natively
  • 62. angular 2 - a traveler's diary by Shavit Cohen 62 Use Arrow Functions angular 2 - a traveler's diary by Shavit Cohen In a ES2015 class you are working with this. Anonymous functions might make you to loose the current scope.
  • 63. angular 2 - a traveler's diary by Shavit Cohen 63angular 2 - a traveler's diary by Shavit Cohen Embrace TypeScript
  • 64. angular 2 - a traveler's diary by Shavit Cohen 64angular 2 - a traveler's diary by Shavit Cohen Notice the difference
  • 65. That’s it (almost) 65angular 2 - a traveler's diary by Shavit Cohen
  • 66. Why now ? 66angular 2 - a traveler's diary by Shavit Cohen 2
  • 68. angular 2 - a traveler's diary by Shavit Cohen Sources Thinking in Angular 2.0 Angular 2 documentation Change Detection Reinvented Victor Savkin PluralSight Course by John Papa - Angular 2.0 First Look Get 6 months of PluralSight for free 68