Slide 1

Slide 1 text

Um framework. Mobile & desktop.

Slide 2

Slide 2 text

Ciro Nunes @cironunesdev

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Um framework. Mobile & desktop.

Slide 6

Slide 6 text

2. Como distribuir para múltiplas plataformas 3. Arquitetura e um pouco de código 1. O que faz o Angular 2 ser tão bom?

Slide 7

Slide 7 text

2. Como distribuir para múltiplas plataformas 3. Arquitetura e um pouco de código 1. O que faz o Angular 2 ser tão bom?

Slide 8

Slide 8 text

Múltiplas plataformas

Slide 9

Slide 9 text

Performance

Slide 10

Slide 10 text

Change Detection t AoT Compiler Algumas coisas que deixam o Angular 2 rápido t Optimized JS code for VM + Three shaking t Three shaking Unidirectional data flow Route Lazy loading t Smarter change detection

Slide 11

Slide 11 text

Experiência do desenvolvedor

Slide 12

Slide 12 text

Simplicidade

Slide 13

Slide 13 text

FILTERS (PIPES) sem perder as features que nós conhecemos e amamos DATA BINDING DEPENDENCY INJECTION COMPONENTS DIRECTIVES ROUTING & NAVIGATION MODULES TESTING

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Ferramentas http://slides.com/gerardsans/imworld-ng2-revolution#/4/4

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

TS ES7 ES2016 ES6 ES2015 ES5

Slide 18

Slide 18 text

Extensões

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

http://fiber.google.com/

Slide 24

Slide 24 text

http://builtwithangular2.com/

Slide 25

Slide 25 text

1. O que faz o Angular 2 ser tão bom? 2. Como distribuir para múltiplas plataformas 3. Arquitetura e um pouco de código

Slide 26

Slide 26 text

Desktop

Slide 27

Slide 27 text

Responsive Web Apps

Slide 28

Slide 28 text

Native

Slide 29

Slide 29 text

Mobile

Slide 30

Slide 30 text

Native (NativeScript)

Slide 31

Slide 31 text

Progressive Web Apps

Slide 32

Slide 32 text

Hybrid

Slide 33

Slide 33 text

1. O que faz o Angular 2 ser tão bom? 2. Como distribuir para múltiplas plataformas 3. Arquitetura e um pouco de código

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

~ $ npm i -g angular-cli ~ $ ng new my-project ~ $ ng serve ~ $ ng test ~ $ ng build --prod

Slide 36

Slide 36 text

Components

Slide 37

Slide 37 text

~ $ ng generate component app

Slide 38

Slide 38 text

export class AppComponent { title = 'app works!'; } import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: `

{{title}}

`, styleUrls: ['./app.component.css'] })

Slide 39

Slide 39 text

export class AppComponent { title = 'app works!'; } import { Component } from '@angular/core'; @Component({ selector: 'app-root', template: `

{{title}}

`, styleUrls: ['./app.component.css'] })

Slide 40

Slide 40 text

export class AppComponent { title = 'app works!'; } @Component({ selector: 'app-root', template: `

{{title}}

`, styleUrls: ['./app.component.css'] }) import { Component } from '@angular/core';

Slide 41

Slide 41 text

Data binding

Slide 42

Slide 42 text

http://jsbin.com/hayiyuyeve/edit?html,js,output

Slide 43

Slide 43 text

@Component({ selector: 'my-greeting', template: `

Hello, {{hero.name}}

`, }) export class Greeting { constructor() { this.hero = { name: 'Ciro' } } } http://plnkr.co/edit/MGnF3Ta5IOPYYAyXjFpl?p=preview

Slide 44

Slide 44 text

Binding Example Properties Events Two-way

Slide 45

Slide 45 text

Services

Slide 46

Slide 46 text

~ $ ng generate service feedback

Slide 47

Slide 47 text

@Injectable() export class FeedbackService { constructor() { } }

Slide 48

Slide 48 text

@Injectable() export class FeedbackService { private feedbacksUrl = 'http://localhost:4222/feedbacks'; constructor(private http: Http) { } getFeedbacks(): Observable { return this.http.get(this.feedbacksUrl) .map(this.extractData); } }

Slide 49

Slide 49 text

Dependency Injection

Slide 50

Slide 50 text

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], providers: [FeedbackService] }) export class AppComponent implements OnInit { feedbacks: Feedback[]; constructor(private feedbackService: FeedbackService) {} ngOnInit() { this.feedbackService.getFeedbacks() .subscribe(feedbacks => this.feedbacks = feedbacks); } }

Slide 51

Slide 51 text

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'], providers: [FeedbackService] }) export class AppComponent implements OnInit { feedbacks: Feedback[]; constructor(private feedbackService: FeedbackService) {} ngOnInit() { this.feedbackService.getFeedbacks() .subscribe(feedbacks => this.feedbacks = feedbacks); } }

Slide 52

Slide 52 text

Directives

Slide 53

Slide 53 text

~ $ ng generate directive highlight

Slide 54

Slide 54 text

@Directive({ selector: '[myHighlight]' }) export class HighlightDirective { constructor(el: ElementRef, renderer: Renderer) { renderer.setElementStyle(el.nativeElement, 'backgroundColor', 'yellow'); } }

Slide 55

Slide 55 text

@Directive({ selector: '[myHighlight]' }) export class HighlightDirective { constructor(el: ElementRef, renderer: Renderer) { renderer.setElementStyle(el.nativeElement, 'backgroundColor', 'yellow'); } }

Slide 56

Slide 56 text

Pipes

Slide 57

Slide 57 text

@Component({ selector: 'hero-birthday', template: `

The hero's birthday is {{ birthday | date }}

` }) export class HeroBirthdayComponent { birthday = new Date(1988, 3, 15); // April 15, 1988 }

Slide 58

Slide 58 text

Modules

Slide 59

Slide 59 text

import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }

Slide 60

Slide 60 text

import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }

Slide 61

Slide 61 text

http://github.com/cironunes/feedbacky

Slide 62

Slide 62 text

@cironunesdev

Slide 63

Slide 63 text

Obrigado!