Skip to content

Instantly share code, notes, and snippets.

// accessing controller in route's model hook
App.PostsRoute = Em.Route.extend({
model: function() {
// getPosts will return a promise
return this.get('controller').getPosts();
}
computedArray: function() {
var self = this;
ajax('/someurl').then(function(jsonArray) {
self.set('computedArray', jsonArray);
});
}.property()
App.TBodyView = Ember.CollectionView.extend({
itemViewClass: 'App.TRView',
createChildView: function(view, attrs) {
var columns = this.get('columns');
return this._super(view, { content: columns,
row: attrs.content,
contentIndex: attrs.contentIndex
});
}