Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Criando componentes interativos em páginas AMP ...
Search
Murilo de Siqueira Ferreira
November 12, 2018
Programming
28
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Criando componentes interativos em páginas AMP com <amp-bind>
Murilo de Siqueira Ferreira
November 12, 2018
More Decks by Murilo de Siqueira Ferreira
See All by Murilo de Siqueira Ferreira
html robusto e elegante
muhroots
0
25
Introdução ao AMP (Accelerated Mobile Pages)
muhroots
0
27
Acessibilidade na web
muhroots
0
43
Other Decks in Programming
See All in Programming
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
680
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
380
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.3k
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
460
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Code Reviewing Like a Champion
maltzj
529
40k
Ruling the World: When Life Gets Gamed
codingconduct
0
400
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
From π to Pie charts
rasagy
1
400
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
The browser strikes back
jonoalderson
0
1.8k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
550
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Transcript
<amp-bind>
instantaneamente
None
None
JS
None
➔ ➔ ➔ interações complexas
None
➔ ➔ ➔
➔ ➔
<amp-state id="myState"> <script type="application/json"> { myText: "Hello AMP" } </script>
</amp-state>
<amp-state id="myState"> <script type="application/json"> { myText: "Hello AMP" } </script>
</amp-state> <span [text]="myState.myText"> Hello World </span>
None
<amp-state id="myState"> <script type="application/json"> { "myText": "Hello AMP" } </script>
</amp-state> <span [text]="myState.myText">Hello World</span> <button on="tap:AMP.setState({ myState: { myText: 'Hello Binding' } })">SetState</button>
None
<amp-state id="myState"> <script type="application/json"> { "myText": "Hello world AMP" }
</script> </amp-state> <!-- change browser history --> <button on="tap:AMP.pushState({ myState: { myText: 'Browser History' } })">SetState</button>
None
None
➔ ➔
// Returns [1, 2, 3] [3, 2, 1].sort() // Returns
6. [1, 2, 3].reduce((x, y) => x + y) // Object to Array keys(event.speakers).map(x => event.speakers[x])
String charAt charCodeAt concat indexOf lastIndexOf slice split substr substring
toLowerCase toUpperCase Number toExponential toFixed toPrecision toString Objects keys value Array concat filter includes indexOf join lastIndexOf map reduce slice some sort splice Math abs ceil floor max min random round Global encodeURIComponent
<amp-list id="speakers" [src]="keys(speakers).map(x => speakers[x])")> <template type="amp-mustache"> <strong>{{name}}</strong> <span>{{jobTitle}}</span> </template>
</amp-list>
<amp-bind-macro id="circle" arguments="r" expression="3.14 * r * r" />
<amp-bind-macro id="SpeakersBind" arguments="speakers" expression="keys(speakers).map(x => speakers[x])" /> <amp-list id="speakers" [src]="SpeakersBind(event.speakers)")>
<template type="amp-mustache"> <strong>{{name}}</strong> <span>{{jobTitle}}</span> </template> </amp-list>
None
<input type="checkbox" [checked]="creditcard._1177" [disabled]="checkeds == 4">
None
<!-- Add/Remove --> <input type="checkbox" [checked]="creditcards && creditcards._1177" [disabled]="checkeds ==
4 && !creditcards._1177" on="change:AMP.setState({ creditcards: { _1177: event.checked, }, checkeds: (event.checked ? checkeds+1 : checkeds-1), })">
<!-- Change text --> <span [text]="creditcards._1177 ? 'Remover' : 'Comparar'")
Comparar </span> <!-- Remove all --> <button on="tap:AMP.setState({ checkeds: 0, creditcards: null })") Remover tudo </button>
None
None
None
None
None
@muhroots