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
【あのMCPって、どんな処理してるの?】 AWS CDKでの開発で便利なAWS MCP Servers特集
yoshimi0227
6
940
AWS 怖い話 WAF編 @fillz_noh #AWSStartup #AWSStartup_Kansai
fillznoh
0
130
セキュアな社内Dify運用と外部連携の両立 ~AIによるAPIリスク評価~
zozotech
PRO
0
120
AI時代にも変わらぬ価値を発揮したい: インフラ・クラウドを切り口にユーザー価値と非機能要件に向き合ってエンジニアとしての地力を培う
netmarkjp
0
130
CDK Toolkit Libraryにおけるテストの考え方
smt7174
1
550
OpenTelemetryセマンティック規約の恩恵とMackerel APMにおける活用例 / SRE NEXT 2025
mackerelio
3
2k
Introduction to Bill One Development Engineer
sansan33
PRO
0
260
VS CodeとGitHub Copilotで爆速開発!アップデートの波に乗るおさらい会 / Rapid Development with VS Code and GitHub Copilot: Catch the Latest Wave
yamachu
3
450
[SRE NEXT 2025] すみずみまで暖かく照らすあなたの太陽でありたい
carnappopper
2
460
microCMSではじめるAIライティング
himaratsu
0
150
PHPからはじめるコンピュータアーキテクチャ / From Scripts to Silicon: A Journey Through the Layers of Computing
tomzoh
2
120
セキュアなAI活用のためのLiteLLMの可能性
tk3fftk
1
330
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
695
190k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
BBQ
matthewcrist
89
9.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Navigating Team Friction
lara
187
15k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
The Cult of Friendly URLs
andyhume
79
6.5k
Being A Developer After 40
akosma
90
590k
Fireside Chat
paigeccino
37
3.5k
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