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
53
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
60
angular#4
sprit3dan
0
170
angular#2
sprit3dan
0
44
Angular#1
sprit3dan
0
73
HTML 5 Canvas
sprit3dan
0
53
Angular #6
sprit3dan
0
79
Angular #5
sprit3dan
0
130
Other Decks in Education
See All in Education
オンラインコミュニティ TRY部 体験マニュアル
ytapples613
0
350
AIの力を100%引き出すために
frievea
0
480
学生のうちに考えておきたい信頼の話
suisan
1
770
Examen de Selectividad. Geografía julio 2026 (Convocatoria Extraordinaria). UCLM
juanmartin2026
1
13k
新しいJavaを学んで・使っていこう! / osd26do
gishi_yama
0
250
Tableau Public入門ハンズオン|Titanicデータで学ぶViz作成とMakeover
hayashi_ds017
0
120
Estimating Group × Time Interaction in Scale-Transformed CEFR-J Self-Assessment Scores: A Case in Study-Abroad Research
uranoken
1
220
[2026前期火5] 論理学(京都大学文学部 前期 第11回)「ハーモニー:三層モデルと保存拡大」
yatabe
0
280
データマネジメント試験対策教材1〜データマネジメント基礎〜
yoshimura_datam
1
710
[2026前期火5] 論理学(京都大学文学部 前期 第12回)「証明を走らせる:カリー・ハワード対応」
yatabe
0
300
Portable & Reproducible Research Environments in the Age of AI Agents
denkiwakame
0
710
An Experiment in "Cross-Cultural Exchange" as a Method for Content Creation
naoji_taniguchi_ksk_0827
0
140
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
540
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Fireside Chat
paigeccino
42
4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Agile that works and the tools we love
rasmusluckow
331
22k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
440
Measuring & Analyzing Core Web Vitals
bluesmoon
9
990
Making Projects Easy
brettharned
120
6.7k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
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; } }