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#3
Search
Danila Marchenkov
September 05, 2017
Education
0
47
angular#3
Danila Marchenkov
September 05, 2017
Tweet
Share
More Decks by Danila Marchenkov
See All by Danila Marchenkov
Rxjs
sprit3dan
0
100
angular6
sprit3dan
0
76
angular5
sprit3dan
0
56
angular#4
sprit3dan
0
160
angular#2
sprit3dan
0
39
Angular#1
sprit3dan
0
56
HTML 5 Canvas
sprit3dan
0
46
Angular #6
sprit3dan
0
72
Angular #5
sprit3dan
0
120
Other Decks in Education
See All in Education
TinyGoをWebブラウザで動かすための方法+アルファ_20260201
masakiokuda
2
280
心理学を学び活用することで偉大なスクラムマスターを目指す − 大学とコミュニティを組み合わせた学びの循環 / Becoming a great Scrum Master by learning and using psychology
psj59129
1
2k
環境・社会理工学院(建築学系)大学院説明会 2026|東京科学大学(Science Tokyo)
sciencetokyo
PRO
0
460
Leveraging LLMs for student feedback in introductory data science courses (Stats Up AI)
minecr
1
230
2025年の本当に大事なAI動向まとめ
frievea
1
190
1202
cbtlibrary
0
220
2026 Medicare 101 Presentation
robinlee
PRO
0
180
ブランチ操作 / 02-a-branch
kaityo256
PRO
0
190
160人の中高生にAI・技術体験の講師をしてみた話
shuntatoda
1
380
滑空スポーツ講習会2025(実技講習)EMFT講習 実施要領/JSA EMFT 2025 procedure
jsaseminar
0
140
Lenguajes de Programacion (Ingresantes UNI 2026)
robintux
0
110
Introduction - Lecture 1 - Next Generation User Interfaces (4018166FNR)
signer
PRO
2
4.5k
Featured
See All Featured
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
210
Leo the Paperboy
mayatellez
4
1.5k
エンジニアに許された特別な時間の終わり
watany
106
240k
Unsuck your backbone
ammeep
672
58k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
150
My Coaching Mixtape
mlcsv
0
69
Un-Boring Meetings
codingconduct
0
220
Building Adaptive Systems
keathley
44
3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
170
Building AI with AI
inesmontani
PRO
1
790
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
150
Transcript
Angular Marchenkov Danila, Software Developer
angularJS filters Pipes
Pipes Built-in Custom
import { Component } from '@angular/core'; @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 }
aPipe | bPipe | cPipe
best way to manipulate data to display
import { Pipe, PipeTransform } from '@angular/core'; /* * Raise
the value exponentially * Takes an exponent argument that defaults to 1. * Usage: * value | exponentialStrength:exponent * Example: * {{ 2 | exponentialStrength:10 }} * formats to: 1024 */ @Pipe({name: 'exponentialStrength'}) export class ExponentialStrengthPipe implements PipeTransform { transform(value: number, exponent: string): number { let exp = parseFloat(exponent); return Math.pow(value, isNaN(exp) ? 1 : exp); } }
Pure vs Inpure
Pure pipes Angular executes a pure pipe only when it
detects a pure change to the input value. A pure change is either a change to a primitive input value (String, Number, Boolean, Symbol) or a changed object reference (Date, Array, Function, Object).
Impure pipes Angular executes an impure pipe during every component
change detection cycle
import { Pipe, PipeTransform } from '@angular/core'; import { Http
} from '@angular/http'; @Pipe({ name: 'fetch', pure: false }) export class FetchJsonPipe implements PipeTransform { private cachedData: any = null; private cachedUrl = ''; constructor(private http: Http) { } transform(url: string): any { if (url !== this.cachedUrl) { this.cachedData = null; this.cachedUrl = url; this.http.get(url) .map( result => result.json() ) .subscribe( result => this.cachedData = result ); } return this.cachedData; } }