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
120
ÉTICA, INCLUSIÓN, EDUCACIÓN INTEGRAL Y NEURODERECHOS EN EL CONTEXTO DEL NEUROMANAGEMENT
jvpcubias
0
120
[FUN Open Campus 2025] 何でもセンシングしていいですか?
pman0214
0
270
~キャラ付け考えていますか?~ AI時代だからこそ技術者に求められるセルフブランディングのすゝめ
masakiokuda
7
520
1014
cbtlibrary
0
470
Transición del Management al Neuromanagement
jvpcubias
0
240
今の私を形作る4つの要素と偶然の出会い(セレンディピティ)
mamohacy
2
110
中央教育審議会 教育課程企画特別部会 情報・技術ワーキンググループに向けた提言 ー次期学習指導要領での情報活用能力の抜本的向上に向けてー
codeforeveryone
0
360
Web Architectures - Lecture 2 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
高校におけるプログラミング教育を考える
naokikato
PRO
0
170
Ch1_-_Partie_1.pdf
bernhardsvt
0
430
探査機自作ゼミ2025スライド
sksat
3
830
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
11k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
4 Signs Your Business is Dying
shpigford
186
22k
We Have a Design System, Now What?
morganepeng
53
7.9k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
680
Music & Morning Musume
bryan
46
6.9k
Unsuck your backbone
ammeep
671
58k
Building an army of robots
kneath
306
46k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
658
61k
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; } }