title: Angularjs When and Where to bind events
body: <p>I'm still learning Angularjs, I want to bind events on a dynamic template when and where should I put this the Angularjs way? Aside from directly putting it in the template ng-click</p>
  
  <pre><code>//template
  &lt;div ng-repeat="person in people"&gt;&lt;span class="person" id="{{person.id}}" &gt;{{person.name}}&lt;/span&gt;&lt;/div&gt;
  
  //Jquery version
  $('.person').click(function(){
    //get attribute value
    //do stuff
  });
  
  //Angular version - where should I put this
  angular.element('.person').on('click', function() {
    //get attribute value
    //do stuff
  });
  </code></pre>