Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Angular: Um framework. Mobile & desktop.
Search
Ciro Nunes
October 22, 2016
Programming
1
600
Angular: Um framework. Mobile & desktop.
Ciro Nunes
October 22, 2016
Tweet
Share
More Decks by Ciro Nunes
See All by Ciro Nunes
Rust Front-end with Yew
cironunes
0
67
Type safe CSS with Reason
cironunes
0
140
What I've learned building automated docs for Ansarada's design system
cironunes
0
85
Beyond ng new
cironunes
2
220
Animate your Angular apps
cironunes
0
450
Sweet Angular, good forms never felt so good
cironunes
0
91
Sweet Angular, good forms never felt so good
cironunes
0
310
Progressive Angular apps
cironunes
3
920
Firebase & Angular
cironunes
0
300
Other Decks in Programming
See All in Programming
Understanding Apache Lucene - More than just full-text search
spinscale
0
140
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
Claude Codeログ基盤の構築
giginet
PRO
7
3.6k
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
510
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
170
The free-lunch guide to idea circularity
hollycummins
0
330
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
150
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
140
Nostalgia Meets Technology: Super Mario with TypeScript
manfredsteyer
PRO
0
110
Claude Code Skill入門
mayahoney
0
420
見せてもらおうか、 OpenSearchの性能とやらを!
shunta27
1
100
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.1k
Featured
See All Featured
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
360
From π to Pie charts
rasagy
0
160
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
280
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
The agentic SEO stack - context over prompts
schlessera
0
710
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
92
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
GraphQLとの向き合い方2022年版
quramy
50
14k
Transcript
Um framework. Mobile & desktop.
Ciro Nunes @cironunesdev
None
None
Um framework. Mobile & desktop.
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?
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?
Múltiplas plataformas
Performance
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
Experiência do desenvolvedor
Simplicidade
FILTERS (PIPES) sem perder as features que nós conhecemos e
amamos DATA BINDING DEPENDENCY INJECTION COMPONENTS DIRECTIVES ROUTING & NAVIGATION MODULES TESTING
None
Ferramentas http://slides.com/gerardsans/imworld-ng2-revolution#/4/4
None
TS ES7 ES2016 ES6 ES2015 ES5
Extensões
None
None
None
None
http://fiber.google.com/
http://builtwithangular2.com/
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
Desktop
Responsive Web Apps
Native
Mobile
Native (NativeScript)
Progressive Web Apps
Hybrid
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
None
~ $ npm i -g angular-cli ~ $ ng new
my-project ~ $ ng serve ~ $ ng test ~ $ ng build --prod
Components
~ $ ng generate component app
export class AppComponent { title = 'app works!'; } import
{ Component } from '@angular/core'; @Component({ selector: 'app-root', template: `<h1>{{title}}</h1>`, styleUrls: ['./app.component.css'] })
export class AppComponent { title = 'app works!'; } import
{ Component } from '@angular/core'; @Component({ selector: 'app-root', template: `<h1>{{title}}</h1>`, styleUrls: ['./app.component.css'] })
export class AppComponent { title = 'app works!'; } @Component({
selector: 'app-root', template: `<h1>{{title}}</h1>`, styleUrls: ['./app.component.css'] }) import { Component } from '@angular/core';
Data binding
http://jsbin.com/hayiyuyeve/edit?html,js,output
@Component({ selector: 'my-greeting', template: ` <input type="text" [(ngModel)]="hero.name"> <h2>Hello, {{hero.name}}</h2>
`, }) export class Greeting { constructor() { this.hero = { name: 'Ciro' } } } http://plnkr.co/edit/MGnF3Ta5IOPYYAyXjFpl?p=preview
Binding Example Properties <fy-rating [rating]="feedback.rating"> Events <fy-rating (onRate)="feedback.update($event)"> Two-way <input
type="text" [(ngModel)]="user.name">
Services
~ $ ng generate service feedback
@Injectable() export class FeedbackService { constructor() { } }
@Injectable() export class FeedbackService { private feedbacksUrl = 'http://localhost:4222/feedbacks'; constructor(private
http: Http) { } getFeedbacks(): Observable<Feedback[]> { return this.http.get(this.feedbacksUrl) .map(this.extractData); } }
Dependency Injection
@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); } }
@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); } }
Directives
~ $ ng generate directive highlight
@Directive({ selector: '[myHighlight]' }) export class HighlightDirective { constructor(el: ElementRef,
renderer: Renderer) { renderer.setElementStyle(el.nativeElement, 'backgroundColor', 'yellow'); } }
@Directive({ selector: '[myHighlight]' }) export class HighlightDirective { constructor(el: ElementRef,
renderer: Renderer) { renderer.setElementStyle(el.nativeElement, 'backgroundColor', 'yellow'); } }
Pipes
@Component({ selector: 'hero-birthday', template: `<p>The hero's birthday is {{ birthday
| date }}</p>` }) export class HeroBirthdayComponent { birthday = new Date(1988, 3, 15); // April 15, 1988 }
Modules
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 { }
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 { }
http://github.com/cironunes/feedbacky
@cironunesdev
Obrigado!