SlideShare a Scribd company logo
Angular 2 Overview
Alexander Shevnin, JSC “Arcadia Inc.”
About myself
2
Alexander Shevnin
JSC “Arcadia Inc.”
alexander.shevnin@arcadia.spb.ru
In Arcadia from 2012, last 3 years work mostly with
ASP.NET, C#, AngularJS and TypeScript
Intro 
• New major version of Angular framework from Google
• Single Page Applications
• Built from scratch
• Written on Typescript
• Can run in web worker or server-side
• Npm packages: @angular/*
3
Topics for today:
• Core concepts
• A bit about Reactive programming
• What do I need to use it today (dependencies, browser
compatibility and so on)?
• JIT vs AOT (brief look at compilation)
4
This is NOT about:
• Copying api-documentation
• Comparison with other libraries / frameworks (save for ng1 ;) )
5
Coming from ng1
• Forget everything that you think you know
• No more controllers, services, factories, providers
• No digest loop (no $scope.$apply() at least)
• No $scope at all ;)
• Still having directives though. Much easier to deal with.
6
Hello world
7
• https://embed.plnkr.co/?show=preview&show=app%2Fapp.component.ts
• https://angular.io/docs/ts/latest/quickstart.html
Same functionality in ES5 
8
Data Binding
9
https://plnkr.co/edit/RtrRej?p=preview http://blog.thoughtram.io/angular/2016/10/13/two-way-data-
binding-in-angular-2.html
Data Binding
10
Dependency Injection
11
Component lifecycle
12
Components interaction
• Shared service (hello ng1 ;) )
• @Input/@Output
• ngOnChanges(changes: {[propKey: string]: SimpleChange})
• We can place a local variable on the tag representing the child component
<button (click)="timer.start()">Start</button>
<countdown-timer #timer> </countdown-timer>
• Obtain a link to a child component using @ViewChild:
13
https://angular.io/docs/ts/latest/cookbook/component-communication.html
RxJS
• Reactive Programming
• Implements https://github.com/tc39/proposal-observable
• The Observable type can be used to model push-based data sources such
as DOM events, timer intervals, and sockets.
• Observables can be composed with higher-order combinators.
• Observables do not start emitting data until an observer has subscribed.
• ...is a set of libraries to compose asynchronous and event-based programs using
observable collections and Array#extras style composition in JavaScript
• Observables + Operators + Schedulers
• Can wrap promises, observables, events and provides exception handling and
cancellation
14
https://www.youtube.com/watch?v=R4sTvHXkToQ you might have seen it already 
https://www.youtube.com/watch?v=KOOT7BArVHQ RxJS In-Depth @ AngularConnect
You’ve seen it already
15
Simple example
16
Consider a task
• Given input textbox and api (GET /items?<term>)
• Call it upon user’s input
• Display results
17
Sounds too easy?
How about this?
1. Don’t hit the search endpoint on every key stroke
2. Don’t hit the search endpoint with the same query params
for subsequent requests
3. Deal with out-of-order responses
4. Cancel requests when they are not needed
18
19
Change Detection
20
Let’s take a look back
21
http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/
Zone.JS
• Execution context
• State changes
• Events (click, change, submit…)
• XMLHttpRequests
• Timers (setTimeout, setInterval)
• Monkey-patching on globalScope (Zone.setTimeout)
• No $digest / $apply
• https://www.youtube.com/watch?v=3IqtmUscE_U - good talk about
Zones
22
Change detection
• https://vsavkin.com/change-detection-in-angular-2-4f216b855d4c#.yd0nbcphd
23
Change detection
• https://vsavkin.com/change-detection-in-angular-2-4f216b855d4c#.yd0nbcphd
24
NG2 Compiler
• Generated ViewClasses (no need to parse views all the time)
• Inline class properties (google for Hidden Classes)
25
Use immutable objects
26
• https://vsavkin.com/change-detection-in-angular-2-4f216b855d4c#.yd0nbcphd
JIT Pipeline
1. Write some TypeScript
2. Compile it
3. Bundle
4. Minify
5. Deploy
1. Download application
2. Bootstrap application
3. Compile / generate each view
4. Render application
27
AOT Pipeline
1. Write some TypeScript
2. Compile templates -> generate TypeScript code
3. Compile TypeScript to JavaScript
4. Bundle
5. Minify
6. Deploy
1. Download application
2. Bootstrap application
3. Render application
28
Why even bother?
• Faster page load
• Bundle size
• Strongly-typed ViewClasses
• Can take the best of Google Closure Compiler
• https://w3c.github.io/webappsec-csp/ Content Security Policy
• Energy efficiency
29
JIT AOT
Routing
30
https://vsavkin.com/angular-2-router-d9e30599f9ea#.gyrajhshr
Dependencies
• Core -> Zone.js, Reflect-Metadata, Observables, Promises
• Promises -> native / shims (es6-shim)
• Observables-> RxJS
• Modules -> Module builder / loader (SystemJS, Browserify,
Webpack 1/2)
• AOT -> Typescript, ES2015 modules (no commonjs, no
webpack 1.0)
31
References:
• https://angular.io/
• https://github.com/mgechev/angular-seed - Modular starter project for Angular 2 with
statically typed build and AoT compilation
• https://vsavkin.com/ - site full of useful articles on the topic
• https://leanpub.com/router – a book on Angular 2 router
• http://blog.thoughtram.io/angular/2016/01/06/taking-advantage-of-observables-in-
angular2.html - more on observables example
• http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-
precompilation/ ahead-of-time compilation
32
Q & A

More Related Content

What's hot (20)

PDF
Angular 2 overview
Jesse Warden
 
PDF
Angular 2: What's New?
jbandi
 
PDF
Getting Started with Angular 2
FITC
 
PDF
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
PDF
Angular 2 : le réveil de la force
Nicolas PENNEC
 
PDF
Tech Webinar: Angular 2, Introduction to a new framework
Codemotion
 
PDF
Angular 2 Essential Training
Patrick Schroeder
 
PDF
Angular 2 for Java Developers
Yakov Fain
 
PDF
Introduction to Angular for .NET Developers
Laurent Duveau
 
ODP
Introduction to Angular 2
Knoldus Inc.
 
PDF
Angular 2 - The Next Framework
Commit University
 
PDF
Introduction to Angular 2
Naveen Pete
 
PDF
Quick introduction to Angular 4 for AngularJS 1.5 developers
Paweł Żurowski
 
PDF
Introduction to Angular 2
Dawid Myslak
 
PPTX
Angular1x and Angular 2 for Beginners
Oswald Campesato
 
PPTX
What’s new in angular 2
Ran Wahle
 
PDF
Introduction to angular 2
Dhyego Fernando
 
PDF
Angular 2 Crash Course
Elisha Kramer
 
PPTX
Talk for DevFest 2021 - GDG Bénin
Ezéchiel Amen AGBLA
 
Angular 2 overview
Jesse Warden
 
Angular 2: What's New?
jbandi
 
Getting Started with Angular 2
FITC
 
The evolution of Angular 2 @ AngularJS Munich Meetup #5
Johannes Weber
 
Angular 2 : le réveil de la force
Nicolas PENNEC
 
Tech Webinar: Angular 2, Introduction to a new framework
Codemotion
 
Angular 2 Essential Training
Patrick Schroeder
 
Angular 2 for Java Developers
Yakov Fain
 
Introduction to Angular for .NET Developers
Laurent Duveau
 
Introduction to Angular 2
Knoldus Inc.
 
Angular 2 - The Next Framework
Commit University
 
Introduction to Angular 2
Naveen Pete
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Paweł Żurowski
 
Introduction to Angular 2
Dawid Myslak
 
Angular1x and Angular 2 for Beginners
Oswald Campesato
 
What’s new in angular 2
Ran Wahle
 
Introduction to angular 2
Dhyego Fernando
 
Angular 2 Crash Course
Elisha Kramer
 
Talk for DevFest 2021 - GDG Bénin
Ezéchiel Amen AGBLA
 

Viewers also liked (18)

PDF
AzovDevMeetup 2016 | Машинное обучение, параллельные и распределённые вычисле...
JSC “Arcadia Inc”
 
PDF
AzovDevMeetup 2016 | HBase и Phoenix в качестве основы ETL-приложения на Node...
JSC “Arcadia Inc”
 
PDF
AzovDevMeetup 2016 | Zero downtime — как релизить продукт миллионам пользоват...
JSC “Arcadia Inc”
 
PDF
AzovDevMeetup 2016 | Основы Agile Project Management или Прощай, менеджер про...
JSC “Arcadia Inc”
 
PDF
AzovDevMeetup 2016 | Выстраивание процесса и применение Best Practices с нуля...
JSC “Arcadia Inc”
 
PDF
AzovDevMeetup 2016 | Сертификация ISTQB для QA инженера | Артём Кравченко
JSC “Arcadia Inc”
 
PDF
Using zone.js
Standa Opichal
 
PPTX
Angular 2 a traveler's diary
Shavit Cohen
 
PPTX
Angular 2.0
Nitin Giri
 
PPTX
Brief intro 2 to angular 2
Selasie Hanson
 
PDF
Commit University - Exploring Angular 2
Commit University
 
PPTX
PPT on Angular 2 Development Tutorial
Paddy Lock
 
PPTX
Angular 2 with typescript
Tayseer_Emam
 
PDF
Get that Corner Office with Angular 2 and Electron
Lukas Ruebbelke
 
PPTX
Angular js 2
Ran Wahle
 
PPTX
An afternoon with angular 2
Mike Melusky
 
PPTX
Angular 2
Nigam Goyal
 
PDF
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Codemotion
 
AzovDevMeetup 2016 | Машинное обучение, параллельные и распределённые вычисле...
JSC “Arcadia Inc”
 
AzovDevMeetup 2016 | HBase и Phoenix в качестве основы ETL-приложения на Node...
JSC “Arcadia Inc”
 
AzovDevMeetup 2016 | Zero downtime — как релизить продукт миллионам пользоват...
JSC “Arcadia Inc”
 
AzovDevMeetup 2016 | Основы Agile Project Management или Прощай, менеджер про...
JSC “Arcadia Inc”
 
AzovDevMeetup 2016 | Выстраивание процесса и применение Best Practices с нуля...
JSC “Arcadia Inc”
 
AzovDevMeetup 2016 | Сертификация ISTQB для QA инженера | Артём Кравченко
JSC “Arcadia Inc”
 
Using zone.js
Standa Opichal
 
Angular 2 a traveler's diary
Shavit Cohen
 
Angular 2.0
Nitin Giri
 
Brief intro 2 to angular 2
Selasie Hanson
 
Commit University - Exploring Angular 2
Commit University
 
PPT on Angular 2 Development Tutorial
Paddy Lock
 
Angular 2 with typescript
Tayseer_Emam
 
Get that Corner Office with Angular 2 and Electron
Lukas Ruebbelke
 
Angular js 2
Ran Wahle
 
An afternoon with angular 2
Mike Melusky
 
Angular 2
Nigam Goyal
 
Understanding Angular 2 - Shmuela Jacobs - Codemotion Milan 2016
Codemotion
 
Ad

Similar to AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин (20)

PPTX
Angular 2 in-1
GlobalLogic Ukraine
 
PDF
Angular v2 et plus : le futur du développement d'applications en entreprise
LINAGORA
 
PDF
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
PPTX
Introduction to angular | Concepts and Environment setup
Ansley Rodrigues
 
PPTX
Angular 2 On Production (IT Talk in Dnipro)
Oleksandr Tryshchenko
 
PDF
Angular meetup 2 2019-08-29
Nitin Bhojwani
 
PDF
Angular, the New Angular JS
Kenzan
 
PPTX
Angular 9
Raja Vishnu
 
PPTX
Angular 18 course for begineers and experienced
tejaswinimysoola
 
PDF
How To Tweak Angular 2 Performance
Oleksandr Tryshchenko
 
PPTX
What's new in Angular 2?
Alfred Jett Grandeza
 
PPTX
Introduction to Angular2
Ivan Matiishyn
 
PPTX
Angular interview questions
Goa App
 
PDF
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
PDF
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
Alex Ershov
 
PDF
Angular 2 overview in 60 minutes
Loiane Groner
 
PDF
Angular Notes.pdf
sagarpal60
 
PPTX
Angular 2 KTS
John Vall
 
PDF
Angular js
Felixits
 
PDF
Angular js
Felixits
 
Angular 2 in-1
GlobalLogic Ukraine
 
Angular v2 et plus : le futur du développement d'applications en entreprise
LINAGORA
 
better-apps-angular-2-day1.pdf and home
ChethanGowda886434
 
Introduction to angular | Concepts and Environment setup
Ansley Rodrigues
 
Angular 2 On Production (IT Talk in Dnipro)
Oleksandr Tryshchenko
 
Angular meetup 2 2019-08-29
Nitin Bhojwani
 
Angular, the New Angular JS
Kenzan
 
Angular 9
Raja Vishnu
 
Angular 18 course for begineers and experienced
tejaswinimysoola
 
How To Tweak Angular 2 Performance
Oleksandr Tryshchenko
 
What's new in Angular 2?
Alfred Jett Grandeza
 
Introduction to Angular2
Ivan Matiishyn
 
Angular interview questions
Goa App
 
Angular (v2 and up) - Morning to understand - Linagora
LINAGORA
 
26 top angular 8 interview questions to know in 2020 [www.full stack.cafe]
Alex Ershov
 
Angular 2 overview in 60 minutes
Loiane Groner
 
Angular Notes.pdf
sagarpal60
 
Angular 2 KTS
John Vall
 
Angular js
Felixits
 
Angular js
Felixits
 
Ad

Recently uploaded (20)

PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
PPTX
Engineering the Java Web Application (MVC)
abhishekoza1981
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Writing Better Code - Helping Developers make Decisions.pptx
Lorraine Steyn
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Capcut Pro Crack For PC Latest Version {Fully Unlocked} 2025
hashhshs786
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
3uTools Full Crack Free Version Download [Latest] 2025
muhammadgurbazkhan
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
MiniTool Power Data Recovery Full Crack Latest 2025
muhammadgurbazkhan
 
Engineering the Java Web Application (MVC)
abhishekoza1981
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Platform for Enterprise Solution - Java EE5
abhishekoza1981
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 

AzovDevMeetup 2016 | Angular 2: обзор | Александр Шевнин