context data in event handler within "foreach" #130

manuelbrunner opened this Issue Feb 3, 2013 · 4 comments

2 participants


Using Blade (v3.0.0beta7) in Meteor, is there a way to access current object in each blocks within an event handler?

Meteor Template:

  {{#each groups}}
    <div class="delete">{{name}}</div>


foreach groups as group

Event Handler:

'click .delete': (event, template) ->
          console.log this

In Meteor Template I get the group object, in Blade I get the window object.

If there is no such feature yet in Blade:

  • Is this feature planned (would be really helpful)?
  • is there a best practice to get the object id in the event handler (something like appending ID to DOM and traversing DOM)?
@bminer bminer was assigned Feb 3, 2013

@systemlord - this is actually a bug. So, yes. This feature will be added soon. Thanks for posting this issue!

@bminer bminer added a commit that closed this issue Feb 3, 2013
@bminer Fixed #130. Push to 3.0.0rc1. 08b5622
@bminer bminer closed this in 08b5622 Feb 3, 2013

@systemlord - please upgrade to the latest version of Blade and test. Please let me know whether or not it works. :)


It's working now. Thanks for the very fast fix. :)


No problem. Thanks for following up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment