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
47
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
76
angular5
sprit3dan
0
56
angular#4
sprit3dan
0
160
angular#2
sprit3dan
0
39
Angular#1
sprit3dan
0
56
HTML 5 Canvas
sprit3dan
0
46
Angular #6
sprit3dan
0
72
Angular #5
sprit3dan
0
120
Other Decks in Education
See All in Education
高校数学B「統計的な推測」 分野の問題と課題
shimizudan
1
110
Tips for the Presentation - Lecture 2 - Advanced Topics in Big Data (4023256FNR)
signer
PRO
0
500
GOBUSATA紹介
chankawa919
0
130
国際卓越研究大学計画|Science Tokyo(東京科学大学)
sciencetokyo
PRO
0
48k
コマンドラインの使い方 / 01-d-cli
kaityo256
PRO
0
100
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
170k
Leveraging LLMs for student feedback in introductory data science courses (Stats Up AI)
minecr
1
230
1216
cbtlibrary
0
160
Padlet opetuksessa
matleenalaakso
12
15k
栃木県警サイバーセキュリティ研修会2026
nomizone
0
340
Surviving the surfaceless web
jonoalderson
0
730
Chapitre_2_-_Partie_2.pdf
bernhardsvt
2
220
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
BBQ
matthewcrist
89
10k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
980
SEO for Brand Visibility & Recognition
aleyda
0
4.3k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
100
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
110
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
380
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
270
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; } }