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
120
0
Share
Ember ATX: Ember.Evented
Lightning talk about one of my favorite Ember mixins, Ember.Evented!
timgthomas
July 24, 2015
More Decks by timgthomas
See All by timgthomas
Living Style Guides: Bringing Designers and Developers Together
timgthomas
0
250
Icons and the Web: Symbols of the Modern Age
timgthomas
0
190
Constructing Modern UIs with SVG
timgthomas
0
210
Browser Invasion: Desktop Apps and the Web
timgthomas
0
170
Mind the Gap: Bringing Designers and Developers Together
timgthomas
0
140
Zero to App Store: A Hybrid App’s Tale
timgthomas
1
160
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
140
Ember ATX: Components
timgthomas
0
94
Chocolate-Covered Vegetables: Tasty Workflows with Broccoli
timgthomas
0
400
Other Decks in Technology
See All in Technology
QGISプラグイン CMChangeDetector
naokimuroki
1
400
AgentCore×VPCでの設計パターンn選と勘所
har1101
3
280
みんなで作るAWS Tips 100連発 (FinOps編)
schwrzktz
1
300
Bill One 開発エンジニア 紹介資料
sansan33
PRO
6
18k
2026年、知っておくべき最新 サーバレスTips10選/serverless-10-tips
slsops
13
5.2k
コードや知識を組み込む / Incorporate Code and Knowledge
ks91
PRO
0
150
インターネットの技術 / Internet technology
ks91
PRO
0
210
自立を加速させる神器 - EMOasis #11
stanby_inc
0
140
扱える不確実性を増やしていく - スタートアップEMが考える「任せ方」
kadoppe
0
300
クラウドネイティブな開発 ~ 認知負荷に立ち向かうためのコンテナ活用
literalice
0
130
The Journey of Box Building
tagomoris
4
2.8k
Data Hubグループ 紹介資料
sansan33
PRO
0
2.9k
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
980
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
A designer walks into a library…
pauljervisheath
211
24k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
890
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Are puppies a ranking factor?
jonoalderson
1
3.3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
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!