2
我有,我想用过滤商店的路线,但它的使用属性,是不是对模型本身在ember.js中路由非模型参数的习惯用法是什么?
App.Appointment = DS.Model.extend({
details: attr('string')
});
App.Router.map(function(match) {
this.resource("appointments", { path: "/appointments" }, function() {
this.route("index", { path: "/:day/all" });
});
});
当我打的模型法这条路,我简单查询api使用这个“日”属性(因为它是查询后端的合法方式)。但是因为它不是模型的一部分,我不认为这是“应该”应用的方式。
App.AppointmentsIndexRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('appointment', params);
}
});
我应该如何编写一个没有公开模型属性的ember模型的路由?
我还应该提到,当setupController方法被调用时,因为注入的“model”参数是{day:“2013-01-01”}而不是约会模型数组(I可以破解解决这个,但感觉就像我做错了)