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