var a = can.Control.extend({
init: function(element, options) {
a.findAll({}, function(response) {
element.html(can.view('a.ejs',
{
d: response
}
))
})
}
});
var b = can.Control.extend({
init: function(element, options) {
var that = this;
can.view('b.ejs', b.findAll({}).then(function(d) {
return { b : d };
})).done(function(frag)
{
that.element.html(frag);
})
}
});
Out of this two which one is better and why ??
I feel the previous one is less better for deferring the values and also to embed it more parameters. Also in second one we can use combination of b.findAll and also b.findOne
Out of this two which one is better and why ??
I feel the previous one is less better for deferring the values and also to embed it more parameters. Also in second one we can use combination of b.findAll and also b.findOne