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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Danila Marchenkov
September 05, 2017
Education
0
46
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
75
angular5
sprit3dan
0
54
angular#4
sprit3dan
0
160
angular#2
sprit3dan
0
38
Angular#1
sprit3dan
0
55
HTML 5 Canvas
sprit3dan
0
45
Angular #6
sprit3dan
0
69
Angular #5
sprit3dan
0
120
Other Decks in Education
See All in Education
Surviving the surfaceless web
jonoalderson
0
350
【ベテランCTOからのメッセージ】AIとか組織とかキャリアとか気になることはあるけどさ、個人の技術力から目を背けないでやっていきましょうよ
netmarkjp
2
2.2k
Microsoft Office 365
matleenalaakso
0
2.1k
子どものためのプログラミング道場『CoderDojo』〜法人提携例〜 / Partnership with CoderDojo Japan
coderdojojapan
PRO
4
18k
滑空スポーツ講習会2025(実技講習)EMFT講習 実施要領/JSA EMFT 2025 procedure
jsaseminar
0
100
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
IKIGAI World Fes:program
tsutsumi
1
2.6k
都市の形成要因と 「都市の余白」のあり方
sakamon
0
150
心理学を学び活用することで偉大なスクラムマスターを目指す − 大学とコミュニティを組み合わせた学びの循環 / Becoming a great Scrum Master by learning and using psychology
psj59129
1
1.7k
HCI Research Methods - Lecture 7 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
自己紹介 / who-am-i
yasulab
PRO
5
6.3k
AIは若者の成長機会を奪うのか?
frievea
0
180
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
280
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Abbi's Birthday
coloredviolet
1
4.7k
Bash Introduction
62gerente
615
210k
For a Future-Friendly Web
brad_frost
182
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Cult of Friendly URLs
andyhume
79
6.8k
WENDY [Excerpt]
tessaabrams
9
36k
Visualization
eitanlees
150
17k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
KATA
mclloyd
PRO
34
15k
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; } }