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
64
0
Share
Angular - FEMUG AM 4 - Jaime Neves
Femug
June 24, 2017
More Decks by Femug
See All by Femug
Sass - FEMUGAM 4 - Diego Lucena
femugam
0
61
Other Decks in Technology
See All in Technology
GitHub Copilot CLIでWebアクセシビリティを改善した話
tomokusaba
0
120
Amazon Bedrock 経由の Claude Cowork を試してみよう・MCP にも繋いでみよう
sugimomoto
0
240
JICUG あなたのAI駆動開発パートナー IBM Bob を使ったアプリ開発
1ftseabass
PRO
0
120
Claude Codeですべての日常業務を爆速化しよう!
minorun365
PRO
16
15k
AI時代から振り返るTerraform drift運用の歴史 / AI Age Reflections on the History of Terraform Drift Operations
aeonpeople
0
570
GitHub Copilot CLI の Rubber Duck 機能を使ってコーディングの品質をあげよう #techbaton_findy
stefafafan
2
1.2k
Javaで学ぶSOLID原則
negima
1
220
なぜハノーバーメッセに行くべきなのか 〜初参加だから語れること〜
tanakaseiya
0
160
Cloud Run のアップデート 触ってみる&紹介
gre212
0
210
海外カンファレンス「JavaOne」参加レポート ユーザー系IT企業における目的・成果/JavaOne Report Purpose and Results in the User IT Company
muit
0
110
Amazon CloudFrontにおけるAIボットアクセス制御のポイント
kizawa2020
5
300
Agentic AI時代における メルカリのAIガバナンスとガードレール実装
naoichihara
16
16k
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
820
First, design no harm
axbom
PRO
2
1.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
We Are The Robots
honzajavorek
0
230
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4k
How to Talk to Developers About Accessibility
jct
2
210
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