title: Pass named function to an events map
body: <p>I have a Meteor template that includes the following:</p>
  
  <pre><code>{{#with selected_recipe}}
    {{&gt;recipe}}
  {{/with}}
  </code></pre>
  
  <p>In my code (Coffeescript), I want to call a function by name from my event map (Backbone-style):</p>
  
  <pre><code>Template.recipe.events = {
    'click #btn-edit-recipe': 'editRecipe'
  }
  
  editRecipe = (event) -&gt;
    console.log @  #should log the selected_recipe object
    #edit recipe
  </code></pre>
  
  <p>However, this fails. When I click on my button in the recipe template, I get <code>Uncaught TypeError: Object editRecipe has no method 'call' (liveui.js:651)</code> I learned event maps from Backbone, and maybe Meteor is different. I can get it to work with:</p>
  
  <pre><code>Template.recipe.events = {
    'click #btn-edit-recipe': -&gt; editRecipe.call(@, event)
  }
  </code></pre>
  
  <p>Is this the right way to do this? Or am I making some simple error? I've always liked using event maps this way because it summarizes the behaviors of the rendered template in just a few lines. Anonymous functions can spread the list out, making it harder to read, and of course they are not reusable.</p>