This file contains hidden or 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
// Last commit: 1aaa729 (2013-03-12 14:44:55 +0000) | |
(function() { | |
window.DS = Ember.Namespace.create({ | |
// this one goes past 11 | |
CURRENT_API_REVISION: 12 | |
}); | |
})(); |
This file contains hidden or 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
// Messages and detail routes are rendered inside the thing template. | |
// The thing template should have an {{outlet}} where the sub-routes should be rendered | |
App.Router.map(function(){ | |
this.resource('thing', {path: 'things/:thing_id'}, function() { | |
this.resource('messages'); | |
this.resource('detail'); | |
}); | |
}); |
This file contains hidden or 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
// This is the presenter class that stores the state | |
App.FooPresenter = Em.ObjectProxy.create({ | |
textAreaContent: '', | |
isExpanded: false | |
}); | |
// This is your controller - be sure to set the content to a list of models in your route | |
App.FoosController = Em.ArrayController.extend({ | |
presenters: function() { |
This file contains hidden or 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
// Last commit: 3599f08 (2013-06-15 22:24:44 +0100) | |
(function() { | |
Ember.Adapter = Ember.Object.extend({ | |
find: function(record, id) { | |
throw new Error('Ember.Adapter subclasses must implement find'); | |
}, | |
findQuery: function(klass, records, params) { |
This file contains hidden or 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
// Last commit: 3599f08 (2013-06-15 22:24:44 +0100) | |
(function() { | |
Ember.Adapter = Ember.Object.extend({ | |
find: function(record, id) { | |
throw new Error('Ember.Adapter subclasses must implement find'); | |
}, | |
findQuery: function(klass, records, params) { |
This file contains hidden or 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
// Last commit: 0820cae (2013-06-14 08:39:23 -0700) | |
(function() { | |
Ember.Adapter = Ember.Object.extend({ | |
find: function(record, id) { | |
throw new Error('Ember.Adapter subclasses must implement find'); | |
}, | |
findQuery: function(klass, records, params) { |
This file contains hidden or 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
App.SVGView = Em.View.extend({ | |
didInsertElement: function() { | |
this.render(); | |
}, | |
redrawObserver: function() { | |
this.render(); | |
}.property('data1', 'data2'), | |
render: function() { |
This file contains hidden or 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
App.BarChartView = Em.View.extend({ | |
didInsertElement: function() { | |
var el = d3.select('#' + this.elementID); | |
el.select('rect').data(this.get('values')).enter().append('rect'); | |
} | |
}); | |
//template |
This file contains hidden or 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
Library.BooksNewController = Ember.ObjectController.extend | |
save: -> | |
@get('model').save().then => | |
@transitionToRoute('books.book', @get('model')) | |
console.log 'here' | |
This file contains hidden or 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
Ember.Model.reopenClass | |
adapter: MyApp.RESTAdapter.create() | |
camelizeKeys: true | |
rootKey: (-> | |
@toString().split('.').get('lastObject').underscore() | |
).property() | |
collectionKey: (-> | |
Em.get(@, 'rootKey') + 's' |