This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deleting a parent when you have `dependent: :destroy` on the server | |
// given `parent` a parent record | |
// `children` the parent's children | |
var childrenTransaction, parentTransaction; | |
childrenTransaction = this.get('store').transaction(); | |
childrenTransaction.add(parent); | |
parent.deleteRecord(); | |
parentTransaction.add(parent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person, backburner = new Backburner(['sync', 'render']); | |
person = { | |
firstName: null, | |
lastName: null, | |
fullName: null, | |
twitter: null | |
}; | |
function set(prop, val) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JP.DashboardIndexView = Ember.View.extend({ | |
didInsertElement: function() { | |
this.usersChanged(); | |
}, | |
usersChanged: function() { | |
if (!this.$()) { return; } // View not in DOM | |
Ember.run.once(this, 'logUsers'); | |
}.observes('controller.users.@each'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
News = Em.Namespace.create(); | |
News.ArticleController = Ember.Controller.extend(); | |
var get = Ember.get; | |
var Resolver = Ember.DefaultResolver.extend({ | |
parseName:function (fullName) { | |
var nameParts = fullName.split(":"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
propertyInfo: { | |
// include other mixins/properties not listed here | |
includeOtherProperties: true, | |
// do not display these properties | |
skipProperties: ['toString', 'send', 'withTransaction'], | |
// do not display these mixins along with their properties | |
skipMixins: [ 'Ember.Evented'], | |
// don't calculate these CPs automatically (unless cached) | |
expensiveProperties: ['maritalStatus', 'avatar'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Advantage: the adapter can be used by multiple tools at the same time and every `getModelTypes` request is isolated. | |
getModelTypes: function(target, typesReceived, typeAdded, typeUpdated, typeRemoved) { | |
// code to fetch types ... | |
// ... | |
// call typesReceived and pass fetched types | |
typesReceived.call(target, types); | |
// .. setup array observers to call typeAdded, typeUpdated, and typeRemoved on changes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disadvantage: releasing model types will clear all observers | |
// irrespective of how many times getModelTypes was requested | |
// or who made the request | |
getModelTypes: function(target, typesReceived, typeAdded, typeUpdated, typeRemoved) { | |
// code to fetch types ... | |
// ... | |
// call typesReceived and pass fetched types | |
typesReceived.call(target, types); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getModelTypes: function(typeAdded, typeUpdated, typeRemoved) { | |
// code to fetch types ... | |
// ... | |
// .. setup array observers to call typeAdded, typeUpdated, and typeRemoved on changes | |
var releaseMethod = function() { | |
//.. code to clear all observers | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var get = Ember.get, capitalize = Ember.String.capitalize, underscore = Ember.String.underscore, DS = window.DS ; | |
var DataAdapter = Ember.Object.extend({ | |
init: function() { | |
this._super(); | |
this.releaseMethods = Ember.A(); | |
}, | |
/** | |
The application being debugged. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Uncaught TypeError: Cannot call method 'didChange' of undefined ember.js?body=1:2373 | |
chainsDidChange ember.js?body=1:2373 | |
Ember.propertyDidChange ember.js?body=1:2307 | |
Ember.EachProxy.Ember.Object.extend.contentKeyDidChange ember.js?body=1:13319 | |
sendEvent ember.js?body=1:2106 | |
notifyObservers ember.js?body=1:2441 | |
Ember.propertyDidChange ember.js?body=1:2308 | |
iterDeps ember.js?body=1:2345 | |
dependentKeysDidChange ember.js?body=1:2329 | |
Ember.propertyDidChange ember.js?body=1:2306 |
OlderNewer