私は最近CoffeeScriptを学び始めましたが、このような問題に直面しました。私はJavaScriptを書きたい:
TemplateManager.tmpl(this.template, this.modelJSON(), this.templateOptions()).done(
function(rendered) { // something1
}).fail(function(ex) {
// something2
});
どの方法で入手できますか?私はそれを書き直してみる:
TemplateManager.tmpl @template, @modelJSON(), @templateOptions()
.done (rendered) ->
#something1
.fail (ex) ->
#something2
そして私は得る:
TemplateManager.tmpl(this.template, this.modelJSON(), this.templateOptions().done(function(rendered) {
}).fail(function(ex) {
}));