I found this, and I am trying this:
for _notice in ['created', 'edited']
((notice) ->
Template.test[notice] = ->
console.log notice
Session.get notice
)(_notice)
But in console I am getting created twice, also:
> Template.test.edited
> function () {
console.log(notice);
return Session.get(notice);
}
I suppose I want to see edited in function, how could I do that? or how can I define these functions using the for loop?
doloop for this rather than your own SIF: jsfiddle.net/ambiguous/gsPc8donotation, what is SIF?(function(x) { .. })(x)in JavaScript or((x) -> ...)(x)in CoffeeScript.