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
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
360
AI時代のTerminal環境を UNIX哲学で設計・運用する
yasunori0418
1
340
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
290
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
220
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Modernizing iOS Apps
seyfoyun
0
150
Crash Auto Pipelines
veronikapj
1
360
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
300
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
350
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
230
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
360
ActionController meets Protocol Buffers
sorah
1
780
Featured
See All Featured
Mind Mapping
helmedeiros
1
430
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Invisible Side of Design
smashingmag
301
52k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
680
Design in an AI World
tapps
1
380
Building an army of robots
kneath
307
47k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
590
Site-Speed That Sticks
csswizardry
13
1.6k
Six Lessons from altMBA
skipperchong
29
4.6k
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