Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
230
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
38
Functional Ember
tchak
0
280
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
820
Ember.js
tchak
10
1.6k
Other Decks in Programming
See All in Programming
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
140
CloudNative Days Winter 2025: 一週間で作る低レイヤコンテナランタイム
ternbusty
7
2k
認証・認可の基本を学ぼう前編
kouyuume
0
180
モダンJSフレームワークのビルドプロセス 〜なぜReactは503行、Svelteは12行なのか〜
fuuki12
0
200
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
110
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
340
connect-python: convenient protobuf RPC for Python
anuraaga
0
370
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
180
Google Antigravity and Vibe Coding: Agentic Development Guide
mickey_kubo
2
150
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
150
無秩序からの脱却 / Emergence from chaos
nrslib
2
12k
関数実行の裏側では何が起きているのか?
minop1205
1
640
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Why Our Code Smells
bkeepers
PRO
340
57k
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
The Invisible Side of Design
smashingmag
302
51k
Designing for humans not robots
tammielis
254
26k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Speed Design
sergeychernyshev
33
1.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Embracing the Ebb and Flow
colly
88
4.9k
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