Featoff = can.Model.extend("featoff",{
findAll: {
url: '/api.php/specialoffers?',
type: 'GET',
data: { max : 10 , pid : 977 , sid : 5934 }
}
}, {});
Feat = can.Control({ init: function()
{ var that = this; can.view('images/js/mn/temps/featured.ejs', featoff.findAll({}).then(function(d)
{ return { offerdata : d, secTitle : that.element.data('title') }; })).done(function(frag)
{ that.element.html(frag); }) }});
我用 new Feat(); 调用它
这正在工作。所以现在我想在 findAll 中使用不同的参数集重用相同的 Feat 控件,我该怎么做?用什么方法,怎么用??我也可以推迟或覆盖 can.view 吗?
我也可以有一个基本控制器并继续覆盖参数吗?