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
170
Icons and the Web: Symbols of the Modern Age
timgthomas
0
150
Constructing Modern UIs with SVG
timgthomas
0
160
Browser Invasion: Desktop Apps and the Web
timgthomas
0
130
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
100
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
130
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
110
Ember ATX: Components
timgthomas
0
80
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
350
Other Decks in Technology
See All in Technology
Notion x ポストモーテムで広げる組織の学び / Notion x Postmortem
isaoshimizu
1
130
グループ ポリシー再確認 (2)
murachiakira
0
120
Рекомендации с нуля: как мы в Lamoda превратили главную страницу в ключевую точку входа для персонализированного шоппинга. Данил Комаров, Data Scientist, Lamoda Tech
lamodatech
0
820
白金鉱業Meetup_Vol.18_生成AIはデータサイエンティストを代替するのか?
brainpadpr
3
180
Стильный код: натуральный поиск редких атрибутов по картинке. Юлия Антохина, Data Scientist, Lamoda Tech
lamodatech
0
820
アジャイル脅威モデリング#1(脅威モデリングナイト#8)
masakane55
3
240
watsonx.data上のベクトル・データベース Milvusを見てみよう/20250418-milvus-dojo
mayumihirano
0
130
Mastraに入門してみた ~AWS CDKを添えて~
tsukuboshi
0
340
Perl歴約10年のエンジニアがフルスタックTypeScriptに出会ってみた
papix
1
200
より良い開発者体験を実現するために~開発初心者が感じた生成AIの可能性~
masakiokuda
0
220
Winning at PHP in Production in 2025
beberlei
1
210
【Oracle Cloud ウェビナー】ご希望のクラウドでOracle Databaseを実行〜マルチクラウド・ソリューション徹底解説〜
oracle4engineer
PRO
1
120
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
178
53k
Thoughts on Productivity
jonyablonski
69
4.6k
We Have a Design System, Now What?
morganepeng
52
7.5k
Six Lessons from altMBA
skipperchong
28
3.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Being A Developer After 40
akosma
91
590k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
540
Testing 201, or: Great Expectations
jmmastey
42
7.5k
GraphQLとの向き合い方2022年版
quramy
46
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
How STYLIGHT went responsive
nonsquared
100
5.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
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!