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 Data: (Advanced) Patterns
Search
Paul Chavard
September 20, 2013
Programming
2
240
Ember Data: (Advanced) Patterns
Slides for my talk from EmberFest 2013
Paul Chavard
September 20, 2013
Tweet
Share
More Decks by Paul Chavard
See All by Paul Chavard
Le Tour du monde en quatre-vingts jours
tchak
1
39
Functional Ember
tchak
0
290
HTTP
tchak
3
190
Ember Data REBOOT
tchak
0
140
EmberJS Introduction
tchak
1
200
From SproutCore to Ember
tchak
2
250
Ember Data
tchak
11
830
Ember.js
tchak
10
1.6k
Other Decks in Programming
See All in Programming
CSC307 Lecture 09
javiergs
PRO
1
850
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
160
ぼくの開発環境2026
yuzneri
1
290
Head of Engineeringが現場で回した生産性向上施策 2025→2026
gessy0129
PRO
0
190
個人開発は儲からない - それでも開発開始1ヶ月で300万円売り上げた方法
taishiyade
0
110
Go Conference mini in Sendai 2026 : Goに新機能を提案し実装されるまでのフロー徹底解説
yamatoya
0
260
15年目のiOSアプリを1から作り直す技術
teakun
0
490
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
12
6.4k
Apache Iceberg V3 and migration to V3
tomtanaka
0
220
Scaling & Coordinating AI Agents for Development - Tamir Dresher
tamirdresher
0
110
生成AIを活用したソフトウェア開発ライフサイクル変革の現在値
hiroyukimori
PRO
0
130
SourceGeneratorのススメ
htkym
0
670
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Odyssey Design
rkendrick25
PRO
2
520
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
310
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
The untapped power of vector embeddings
frankvandijk
2
1.6k
The browser strikes back
jonoalderson
0
730
Abbi's Birthday
coloredviolet
2
4.9k
Technical Leadership for Architectural Decision Making
baasie
2
260
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
110
Transcript
Ember Data (Advanced) Patterns Paul Chavard Capitaine Train August 30,
2013
Capitaine Train capitainetrain.com • 55 controllers • 22 models
I am going to show you some useful stuff that
actualy works (most of the time) in Ember Data
Filters Dynamic Filter var IndexRoute = Ember.Route.extend ({ model: function
() { return this.store.filter(’post ’, {}, Ember.K); } }); var IndexController = Ember. ArrayController .extend ({ searchText : ’’, searchTextDidChange : function () { var searchText = this.get(’searchText ’). toLowerCase (); var filterFunction = Ember.isEmpty(searchText ) ? Ember.K : function(record) { return record.get(’title ’). toLowerCase () .match( searchText ); }; this.set(’content. filterFunction ’, filterFunction ); }. observes(’searchText ’) });
Batch Saves Save Multiple Models Ember.RSVP.all(post.get(’comments ’). invoke(’save ’)) .then(function
() { alert(’All Saved!’); }, function(reason) { alert(’There was an error because ’ + reason ); }); Save Parent Before Child post.save (). then(function () { return comment.save (); }). then(function () { alert(’All Saved!’); }, function(reason) { alert(’There was an error because ’ + reason ); });
Unload Records Unload Single Record this.store.find(’post ’, 1). unloadRecord ();
Unload Record with its Relationships var Post = DS.Model.extend ({ unloadRecord : function () { this._super (); this. eachRelationship (function(key , relationship ) { if ( relationship .kind === ’hasMany ’) { this.get(key ). toArray (). invoke(’unloadRecord ’); } else { this.get(key ). unloadRecord (); } }, this ); } }); this.store.find(’post ’, 1). unloadRecord ();
Ember Extention
The End