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
250
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ember Data: (Advanced) Patterns
Slides for my talk from EmberFest 2013
Paul Chavard
September 20, 2013
More Decks by Paul Chavard
See All by Paul Chavard
Le Tour du monde en quatre-vingts jours
tchak
1
58
Functional Ember
tchak
0
290
HTTP
tchak
3
210
Ember Data REBOOT
tchak
0
160
EmberJS Introduction
tchak
1
200
From SproutCore to Ember
tchak
2
260
Ember Data
tchak
11
850
Ember.js
tchak
10
1.6k
Other Decks in Programming
See All in Programming
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
4
1.1k
DroidKaigi 2026 「個人開発という実験場: Android エンジニアが手にする4つの自由」
slashnephy
0
220
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
340
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
250
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
4
3k
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
680
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
140
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.3k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
77
5.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
870
Writing Fast Ruby
sferik
630
63k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
How STYLIGHT went responsive
nonsquared
100
6.3k
Marketing to machines
jonoalderson
1
5.7k
BBQ
matthewcrist
89
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
RailsConf 2023
tenderlove
30
1.5k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
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