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
Ember ATX: Ember.Evented
Search
timgthomas
July 24, 2015
Technology
0
110
Ember ATX: Ember.Evented
Lightning talk about one of my favorite Ember mixins, Ember.Evented!
timgthomas
July 24, 2015
Tweet
Share
More Decks by timgthomas
See All by timgthomas
Living Style Guides: Bringing Designers and Developers Together
timgthomas
0
190
Icons and the Web: Symbols of the Modern Age
timgthomas
0
150
Constructing Modern UIs with SVG
timgthomas
0
170
Browser Invasion: Desktop Apps and the Web
timgthomas
0
140
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
110
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
140
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
120
Ember ATX: Components
timgthomas
0
82
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
360
Other Decks in Technology
See All in Technology
american aa airlines®️ USA Contact Numbers: Complete 2025 Support Guide
aaguide
0
320
マネジメントって難しい、けどおもしろい / Management is tough, but fun! #em_findy
ar_tama
7
1.2k
How Do I Contact HP Printer Support? [Full 2025 Guide for U.S. Businesses]
harrry1211
0
120
Lufthansa ®️ USA Contact Numbers: Complete 2025 Support Guide
lufthanahelpsupport
0
220
ビギナーであり続ける/beginning
ikuodanaka
3
780
shake-upを科学する
rsakata
6
630
united airlines ™®️ USA Contact Numbers: Complete 2025 Support Guide
flyunitedhelp
1
420
SEQUENCE object comparison - db tech showcase 2025 LT2
nori_shinoda
0
150
VS CodeとGitHub Copilotで爆速開発!アップデートの波に乗るおさらい会 / Rapid Development with VS Code and GitHub Copilot: Catch the Latest Wave
yamachu
2
170
スタートアップに選択肢を 〜生成AIを活用したセカンダリー事業への挑戦〜
nstock
0
250
LLM時代の検索
shibuiwilliam
2
390
[ JAWS-UG千葉支部 x 彩の国埼玉支部 ]ムダ遣い卒業!FinOpsで始めるAWSコスト最適化の第一歩
sh_fk2
2
110
Featured
See All Featured
Faster Mobile Websites
deanohume
307
31k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
GraphQLの誤解/rethinking-graphql
sonatard
71
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Scaling GitHub
holman
460
140k
Six Lessons from altMBA
skipperchong
28
3.9k
Speed Design
sergeychernyshev
32
1k
YesSQL, Process and Tooling at Scale
rocio
173
14k
It's Worth the Effort
3n
185
28k
Bash Introduction
62gerente
613
210k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
510
Transcript
Hi!
@timgthomas
Scenario
// models/item.js export default Ember.Object.extend({ actions: { save() { this.set('savedAt',
new Date()); } } }); // components/show-item.js export default Ember.Component.extend({ itemSaved: function() { // ... }.observes('item.savedAt') });
”Data Down, Actions Up“
Ember.Evented
// models/item.js export default Ember.Object.extend(Ember.Evented, { actions: { save() {
this.trigger('saved'); } } }); // components/show-item.js export default Ember.Component.extend({ init() { this._super(); this.get('item').on('saved', this.itemSaved); } });
// controllers/list.js export default Ember.Controller.extend(Ember.Evented, { actions: { save() {
this.trigger('saved'); } } }); // controllers/item.js export default Ember.Controller.extend({ init() { this._super(); this.get('controllers.list').on('saved', () => {}); } });
Route Hierarchy Gotcha!
let controller = this.get('controllers.foo'); controller.trigger('foo'); controller.trigger('foo', 'bar'); controller.on('foo', () =>
{}); controller.off('foo', () => {}); controller.one('foo', () => {}); controller.has('foo');
bit.ly/ember-evented
Thanks!