Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ember Data: (Advanced) Patterns
Search
Paul Chavard
September 20, 2013
Programming
260
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
65
Functional Ember
tchak
0
300
HTTP
tchak
3
210
Ember Data REBOOT
tchak
0
170
EmberJS Introduction
tchak
1
210
From SproutCore to Ember
tchak
2
270
Ember Data
tchak
11
860
Ember.js
tchak
10
1.6k
Other Decks in Programming
See All in Programming
オーケストレーション記述言語 Katari
yukikurage
0
220
Web3Dライブラリを作ってVue Custom Rendererの仕組みを理解しよう / lets learn vue custom renderer by making 3d library
drumath2237
1
120
Event is what happens
moro
2
3.2k
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
350
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
2.8k
Seven New Principles of Software Engineering
yegor256
0
440
Groovy as a human and AI friendly programming language
paulk
0
170
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
250
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
220
ActionController meets Protocol Buffers
sorah
1
780
AIがコードを書いてくれる時代、我々は何を確かめるのか
yosuke_furukawa
PRO
13
5.6k
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
6.4k
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
540
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
300
Chasing Engaging Ingredients in Design
codingconduct
0
380
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
My Coaching Mixtape
mlcsv
0
380
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
320
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
460
How to Talk to Developers About Accessibility
jct
2
610
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
740
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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