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
44
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
73
angular5
sprit3dan
0
52
angular#4
sprit3dan
0
160
angular#2
sprit3dan
0
34
Angular#1
sprit3dan
0
52
HTML 5 Canvas
sprit3dan
0
44
Angular #6
sprit3dan
0
68
Angular #5
sprit3dan
0
120
Other Decks in Education
See All in Education
バケットポリシーの記述を誤りマネコンからS3バケットを操作できなくなりそうになった話
amarelo_n24
1
110
みんなのコード 2024年度活動報告書/ 2025年度活動計画書
codeforeveryone
0
340
相互コミュニケーションの難しさ
masakiokuda
0
270
今までのやり方でやってみよう!?~今までのやり方でやってみよう!?~
kanamitsu
0
180
ROSConJP 2025 発表スライド
f0reacharr
0
240
Web Application Frameworks - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
0
3k
Sanapilvet opetuksessa
matleenalaakso
0
33k
みんなのコードD&I推進レポート2025 テクノロジー分野のジェンダーギャップとその取り組みについて
codeforeveryone
0
270
沖ハック~のみぞうさんとハッキングチャレンジ☆~
nomizone
1
280
Human Perception and Cognition - Lecture 4 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.2k
生成AI活用セミナー/GAI-workshop
gnutar
0
120
Ch1_-_Partie_1.pdf
bernhardsvt
0
410
Featured
See All Featured
A better future with KSS
kneath
239
18k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
How STYLIGHT went responsive
nonsquared
100
5.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Code Review Best Practice
trishagee
72
19k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6.1k
For a Future-Friendly Web
brad_frost
180
9.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.3k
Docker and Python
trallard
46
3.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
9
590
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; } }