dynamic - Meteor: Handling events generated from objects wrapped with #each? -


so i'm new meteor, i'm wondering if it's possible catch event dynamically created element:

{{#each appl}}   <div class="col-sm-4">     <div class="panel panel-default">       <div class="panel-heading text-center"><b>{{demuser}}</b></div>        <div class="panel-body">         <img class="imh-responsive img-rounded col-sm-6 col-sm-offset-3" src="/images/faces/face-1.jpg">       </div>        <div class="panel-footer">         <div class="row">           <button class="btn btn-success">hire</button>          <button class="btn btn-info">rdv</button>          <button class="btn btn-danger">reject</button>         </div>       </div>      </div>   </div> {{/each}} 

because using each, context (this) in event map appl (applicant?) document. example:

template.mytemplate.events({   'click .btn-success': function () {     console.log(this._id); // logs appl._id   } }); 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -