$30 off During Our Annual Pro Sale. View Details »
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
74
angular5
sprit3dan
0
53
angular#4
sprit3dan
0
160
angular#2
sprit3dan
0
38
Angular#1
sprit3dan
0
54
HTML 5 Canvas
sprit3dan
0
45
Angular #6
sprit3dan
0
69
Angular #5
sprit3dan
0
120
Other Decks in Education
See All in Education
Evaluation Methods - Lecture 6 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.2k
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.4k
ROSConJP 2025 発表スライド
f0reacharr
0
270
今の私を形作る4つの要素と偶然の出会い(セレンディピティ)
mamohacy
2
120
Node-REDで広がるプログラミング教育の可能性
ueponx
1
210
20251119 如果是勇者欣美爾的話, 他會怎麼做? 東海資工
pichuang
0
140
Introduction - Lecture 1 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
2.7k
Réaliser un diagnostic externe
martine
0
780
2025年度伊藤正彦ゼミ紹介
imash
0
130
外国籍エンジニアの挑戦・新卒半年後、気づきと成長の物語
hypebeans
0
640
Requirements Analysis and Prototyping - Lecture 3 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
3Dプリンタでロボット作るよ#5_ロボット向け3Dプリンタ材料
shiba_8ro
0
120
Featured
See All Featured
Building Adaptive Systems
keathley
44
2.9k
A Tale of Four Properties
chriscoyier
162
23k
A better future with KSS
kneath
240
18k
[SF Ruby Conf 2025] Rails X
palkan
0
500
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Embracing the Ebb and Flow
colly
88
4.9k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
What's in a price? How to price your products and services
michaelherold
246
12k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Thoughts on Productivity
jonyablonski
73
5k
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; } }