运行以下代码时,我收到一个错误,即适配器操作失败。
(aap.js)
App = Ember.Application.create();
App.Store=DS.Store.extend({
adapter:'DS.FixtureAdapter'
});
//App.ApplicationAdapter = DS.FixtureAdapter.extend();
App.Router.map(function(){
this.route('posts');
this.route('about');
});
App.PostsRoute=Ember.Route.extend({
model:function(){
return this.store.find('post');
}
})
答案 0 :(得分:0)
adapter:
参数或适配器对象,例如你创建了像App.ApplicationAdapter = DS.FixtureAdapter.extend();
这样的应用程序适配器,所以你的适配器参数应该是'application'
,但如果没有在商店中指定适配器,它将默认为应用程序适配器,因此需要指定它