Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
angular#3
Search
Danila Marchenkov
September 05, 2017
Education
54
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
angular#3
Danila Marchenkov
September 05, 2017
More Decks by Danila Marchenkov
See All by Danila Marchenkov
Rxjs
sprit3dan
0
110
angular6
sprit3dan
0
80
angular5
sprit3dan
0
62
angular#4
sprit3dan
0
170
angular#2
sprit3dan
0
44
Angular#1
sprit3dan
0
73
HTML 5 Canvas
sprit3dan
0
55
Angular #6
sprit3dan
0
79
Angular #5
sprit3dan
0
130
Other Decks in Education
See All in Education
生成AIとの付き合い方/ How to work with AI
kaityo256
PRO
1
130
One Year of Learning English with AI @エンジニア英語キャリア Meetup #3
kekekenta
0
250
Portable & Reproducible Research Environments in the Age of AI Agents
denkiwakame
0
800
El Clima de España. Tema 2 (PPT)
juanmartin2026
0
3.6k
AIってなぁに?
kenichiota0711
0
850
検定資格の価値 ~実はすごいよQC検定~
bunnchinn3
0
230
Carbohydrates: Classification, Structure & Chemical Properties
pawan_pharm
0
300
Beyond the Prompt: Programming as a Pathway to Statistical Thinking
minecr
0
410
2026年度秋学期 統計学 第1回 イントロダクション ー 統計的なものの見方・考え方について (2026. 9. 29)
akiraasano
PRO
0
200
Comentario del plano urbano de Madrid hasta 1860 (1ª parte )
juanmartin2026
1
99k
私たちはなんでテストするんだっけ? Ver.東北IT物産展2026 in 会津若松
camel_404
3
210
チームの鏡になるー自分の癖を知ると、チームのパターンが見えてくる@スクフェス仙台
saorimurooka
0
220
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
528
40k
Crafting Experiences
bethany
1
360
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
76k
Between Models and Reality
mayunak
4
470
Abbi's Birthday
coloredviolet
4
10k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Designing Experiences People Love
moore
143
24k
Skip the Path - Find Your Career Trail
mkilby
1
240
Everyday Curiosity
cassininazir
0
330
Visualization
eitanlees
153
17k
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; } }