我一直在寻找一种简单的方法来在呈现视图之前调整我的 Ember Data 模型。我怎样才能做到这一点?我尝试使用 setupController 但这似乎不对,因为它们似乎还没有被获取。
代码:
App.Router.map(function() {
this.resource("albums", { path: "/albums" }, function() {
//this.resource('album', { path: ':album_id'});
});
});
App.AlbumsRoute = Ember.Route.extend({
model: function() {
return App.Album.find();
}
});
App.AlbumsController = Ember.ArrayController.extend({ });
感谢您的洞察力。