I start to learn CoffeeScript recently, and I faced with a problem as this. I want to write javascript :
TemplateManager.tmpl(this.template, this.modelJSON(), this.templateOptions()).done(
function(rendered) { // something1
}).fail(function(ex) {
// something2
});
Which way I can get it? I try rewrite that:
TemplateManager.tmpl @template, @modelJSON(), @templateOptions()
.done (rendered) ->
#something1
.fail (ex) ->
#something2
and I get:
TemplateManager.tmpl(this.template, this.modelJSON(), this.templateOptions().done(function(rendered) {
}).fail(function(ex) {
}));