2
在Ember JS中依次加载多个模型的最佳方式是什么?如何在Ember JS路线中顺序加载多个模型
例如
App.ProductRoute = Ember.Route.extend({
model: function(params) {
// first call
this.store.find('Product');
// second call should only be called after the first find is completed
var prod = this.store.find('Product', params.product_id);
// third call should only be called after the above is completed
this.store.find('ProductOptions', prod.get('optionId');
return ???
},
setupController: function(controller, model){
// how would one the set up the controllers?
}
});
This后显示了如何在一个路径的同时加载多个模型。
谢谢kingpin2k - 你太棒了! – TrevTheDev