+ All Categories
Home > Technology > Angular2

Angular2

Date post: 09-Jan-2017
Category:
Upload: software-infrastructure
View: 303 times
Download: 1 times
Share this document with a friend
34
19.08.2016 Yusuf Koraman - Software Architecture ANGULAR2
Transcript
Page 1: Angular2

19.08.2016Yusuf Koraman - Software Architecture

ANGULAR2

YUSUF KORAMAN
Page 2: Angular2

Content

Angular2 What?, When ? Why?

Concept. Difference between AngularJs & Angular2 Angular2 Change Detections Break Time (10 min) Demo (Task Manager) Upgrading From Angular 1.x Angular2 Performance Benchmark QUESTIONS?

Page 3: Angular2

Angular2 What? Why? When?

• It is written entirely in Typescript. • Not an update for Angular 1.x. • Announced @ March 2014• Simpler than Angular 1 and has far fewer concepts, making it easier to

understand• Angular2 is designed from the ground-up for mobile and optimized for

memory efficiency and less CPU cycles.• Angular2 is a «design pattern».• Not Released Yet. @BETA

Page 4: Angular2

Mobile Support

IONIC2 - @Beta NativeScript with Angular2

Page 5: Angular2

Concepts

Page 6: Angular2

Concepts - Components

Page 7: Angular2

Component - Lifecycle

Page 8: Angular2

Concepts – DI

Page 9: Angular2

Differences between AngularJs & Angular2

• Angular 1.x was not built with mobile support, Angular2 is mobile oriented.

• Angular 1.x is easy to setup. Angular2 is dependent of other libraries

• Angular 1.x’s controllers and $scope are gone

Page 10: Angular2

Differences between AngularJs & Angular2

Page 11: Angular2

Differences between AngularJs & Angular2

• Say goodbye to ng-app. The only way to bootstrap angular is via code.

Page 12: Angular2

Differences between AngularJs & Angular2

Page 13: Angular2

Differences between AngularJs & Angular2

• ng-repeat is replaced with *ngFor.• Angular2 uses camelCase syntax – Ex: ng-class ngClass – ng-mode ngModel.

• Angular2 directly uses the valid HTML DOM element properties and events (major change)

Page 14: Angular2

Differences between AngularJs & Angular2

In Angular 1.x, ng-model is used for two way data binding, but with Angular2 it is replaced with [(ngModel)].

Page 15: Angular2

Differences between AngularJs & Angular2

• In Angular 1.x, we can define a services via different ways.(Factory,Service,etc.)

• In Angular 2, class is the only way to define a service.

• Routing• ng-href => [routerLink]• Performance

Page 16: Angular2

Angular2 Change Detections

Page 17: Angular2

Angular2 Change Detections

Page 18: Angular2

Angular2 Change Detections

• Basically application state change can be caused by three things

• Events - click, submit, …• XHR - Fetching data from a remote server• Timers - setTimeout(), setInterval()• They are all asynchronous.

Page 19: Angular2

Angular2 Change Detections

Page 20: Angular2

Angular2 Change Detections

• Who notifies Angular?* Zones* Each component has

its own change detector

Page 21: Angular2

Angular2 Change Detections

Page 22: Angular2

Angular2 Change Detections

Page 23: Angular2

Angular2 Change Detections

Immutable Objects• We’ll always get a new reference with that

change, as the original object is immutable.

Page 24: Angular2

Angular2 Change Detections

Page 25: Angular2

Angular2 Change Detections

Observables • They don’t give us new references when a

change is made. Instead, they fire events we can subscribe to in order to react to them.

Page 26: Angular2

Angular2 Change Detections

What’s the problem?

Page 27: Angular2

Angular2 Change Detections

Page 28: Angular2

Angular2 Change Detections

Page 29: Angular2

Angular2 Change Detections

Page 30: Angular2

Break Time – 10 min.

Page 31: Angular2

DEMO

(Task Manager)

Page 32: Angular2

Upgrading From Angular 1.x

• Creating a new Angular2 project.• Upgrading with The Upgrade Adapter• https://

angular.io/docs/ts/latest/guide/upgrade.html

Page 33: Angular2

Angular 2 Performance Benchmark

http://stefankrause.net/js-frameworks-benchmark/

Page 34: Angular2

Questions


Recommended