0
根據ember數據文檔,如果我想在我的後端應用程序(如/ applications/123)上打一個電話,我使用下面的代碼。在slug(ember)中查找
適配器/ application.js中
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
namespace: 'api/v1',
host:'http://xxxxx.com/',
});
路線/ home.js
import Ember from 'ember';
export default Ember.Route.extend({
model: function (params) {
return this.store.find("Application", params.id);
}
});
但是,我要讓喜歡/應用/ 123 /分析,在分析的呼叫
通話model: function() {
return this.store.find('Analytic');
}
還有什麼比較像樣的方式? – thodwris
@thodwris這種方式非常體面,我不知道如何改進。 –
請看我更新的問題!感謝您的幫助! – thodwris