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 - FEMUG AM 4 - Jaime Neves
Search
Femug
June 24, 2017
Technology
0
63
Angular - FEMUG AM 4 - Jaime Neves
Femug
June 24, 2017
Tweet
Share
More Decks by Femug
See All by Femug
Sass - FEMUGAM 4 - Diego Lucena
femugam
0
59
Other Decks in Technology
See All in Technology
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
490
仕様書駆動AI開発の実践: Issue→Skill→PRテンプレで 再現性を作る
knishioka
2
680
OWASP Top 10:2025 リリースと 少しの日本語化にまつわる裏話
okdt
PRO
3
830
SREチームをどう作り、どう育てるか ― Findy横断SREのマネジメント
rvirus0817
0
330
データの整合性を保ちたいだけなんだ
shoheimitani
8
3.2k
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
370
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
1k
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
210
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
140
CDKで始めるTypeScript開発のススメ
tsukuboshi
1
520
SREが向き合う大規模リアーキテクチャ 〜信頼性とアジリティの両立〜
zepprix
0
470
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.6k
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
220
Ruling the World: When Life Gets Gamed
codingconduct
0
150
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.4k
How to train your dragon (web standard)
notwaldorf
97
6.5k
Paper Plane
katiecoart
PRO
0
46k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Ethics towards AI in product and experience design
skipperchong
2
200
GitHub's CSS Performance
jonrohan
1032
470k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
How to Ace a Technical Interview
jacobian
281
24k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
Transcript
Angular 4º FEMUG - AM Jaime Neves @dejaneves
Jaime Neves @dejaneves Hi, I’m a Front-end Develop passionate about
web and everything related to it. I’m currently working building products with JavaScript at Apassos. jaimeneves.com.br
Empregos Manaus CheckForce.js FieldDrop.js PROJETOS Grupos Front End Manaus FEMUG
- AM IONIC Brazil LookBack.io
Agenda Angular CLI Metadata Module Components/Directives Templates Data Binding Services
Dependency Injection
One framework Mobile & desktop
Angular em toda parte
Cross-Platform Development Electron Ionic Native Script React Native Windows (UWP)
Angular-CLI
Angular CLI Example
Metadata Informa para o Angular como processar uma Class
Metadata - src/app/hero-list.component.ts (class) export class HeroListComponent implements OnInit {
heroes: Hero[]; selectedHero: Hero; constructor(private service: HeroService) { } ngOnInit() { this.heroes = this.service.getHeroes(); } selectHero(hero: Hero) { this.selectedHero = hero; } } Metadata
Metadata - src/app/hero-list.component.ts (metadata) @Component({ selector: 'hero-list', templateUrl: './hero-list.component.html', providers:
[ HeroService ] }) export class HeroListComponent implements OnInit { /* . . . */ } Decorator @Component
MODULE App Angular é modular; Root Module (AppModule); Feature Modules
Module
Module - src/app/app.module.ts import { NgModule } from '@angular/core'; import
{ BrowserModule } from '@angular/platform-browser'; @NgModule({ imports: [ BrowserModule ], providers: [ Logger ], declarations: [ AppComponent ], exports: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }
Module - src/app/app.module.ts imports: Other Modules, providers: Services, declarations: View
Class [Components, Directives and Pipes], exports: [The subset of declarations], bootstrap: [ The main application view ]
Module - src/app/app.module.ts import { Component } from '@angular/core'; @Component({
selector:'my-app', template:` <h1>{{title}}</h1> <nav> <a routerLink="/dashboard" >Dashboard</a> <a routerLink="/heroes" >Heroes</a> </nav> <router-outlet></router-outlet> `, styleUrls:['./app.component.css'] }) export class AppComponent { title = 'Tour of Heroes'; }
Module - src/main.ts import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import
{ AppModule } from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule); Inicie o “root module” https://angular.io/generated/live-examples/ngmodule/minimal.0.eplnkr.html
Module Example
Components/Directives
Componentes Componente controle parte de um código HTML In Angular,
“everything is a component.”
Componentes - src/app/hero-list.component.ts (class) @Component({selector: 'greet', template: 'Hello {{name}}!'}) class
Greet { name: string = 'World'; } A component has a lifecycle managed by Angular.
Templates Gerencia o que o usuário ver e pode fazer
Templates - src/app/hero-list.component.html <h2>Hero List</h2> <p><i>Pick a hero from the
list</i></p> <ul> <li *ngFor="let hero of heroes" (click)="selectHero(hero)"> {{hero.name}} </li> </ul> <hero-detail *ngIf="selectedHero" [hero]="selectedHero"></hero-detail>
Templates
Data Binding
Data Binding Data Binding sem Framework Lógica de push/pull à
mão Experiência com jQuery
Data Binding - src/app/hero-list.component.html (binding) <li>{{hero.name}}</li> <hero-detail [hero]="selectedHero"></hero-detail> <li (click)="selectHero(hero)"></li>
Interpolation property binding event binding
Data Binding - src/app/hero-detail.component.html (ngModel) <input [(ngModel)]="hero.name"> vinculação de propriedades
e eventos
Data Binding (ngModel) Example
Services
Services Categoria Ampla Quase Tudo Pode ser um Serviço Sem
Definição no Angular Componentes Limpos Decorator @Injectable() Arquivo “.service.ts”
Services import { Injectable } from '@angular/core'; @Injectable() export class
HeroService { /* . . . */ }
Services Example
Dependency injection
Dependency injection
Dependency injection constructor(private service: HeroService) { }
Dependency injection src/app/app.module.ts (module providers) Registered a provider providers: [
BackendService, HeroService, Logger ],
Dependency injection src/app/hero-list.component.ts (component providers) Registered a provider @Component({ selector:
'hero-list', templateUrl: './hero-list.component.html', providers: [ HeroService ] })
Obrigado !!! Jaime Neves @dejaneves