I'm new to Coffeescript and I'm having trouble turning this Javascript:
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");
console.log(this);
if (optionalValue) {
console.log("Value");
console.log("====================");
console.log(optionalValue);
}
});
Into working Coffeescript. The part that I'm hung up on is, I think, how to pass the "debug" argument to the registerHelper function, and also pass in an anonymous function that takes an optional argument.
This syntax:
Handlebars.registerHelper: "debug", -> (optionalValue)
console.log("Current Context")
console.log("====================")
console.log(this)
if optionalValue
console.log("Value")
console.log("====================")
Is not working for me.