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
Security, Privacy and Trust - Lecture 11 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
2
3.2k
KBS新事業創造体験2025_科目説明会
yasuchikawakayama
0
160
滑空スポーツ講習会2025(実技講習)EMFT講習 実施要領/JSA EMFT 2025 procedure
jsaseminar
0
100
Node-REDで広がるプログラミング教育の可能性
ueponx
1
260
2025年の本当に大事なAI動向まとめ
frievea
0
170
俺と地方勉強会 - KomeKaigi・地方勉強会への期待 -
pharaohkj
1
1.6k
令和エンジニアの学習法 〜 生成AIを使って挫折を回避する 〜
moriga_yuduru
0
230
Chapitre_2_-_Partie_2.pdf
bernhardsvt
0
160
TypeScript初心者向け完全ガイド
mickey_kubo
1
120
滑空スポーツ講習会2025(実技講習)EMFT学科講習資料/JSA EMFT 2025
jsaseminar
0
220
【ZEPホスト用メタバース校舎操作ガイド】
ainischool
0
170
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Embracing the Ebb and Flow
colly
88
5k
Navigating Team Friction
lara
192
16k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Side Projects
sachag
455
43k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Chasing Engaging Ingredients in Design
codingconduct
0
110
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
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; } }