title: Getting attribute of element in ng-click function in angularjs
body: <p>I have a span tag like below which call a function in the controller when clicked.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="row" ng-repeat="event in events"&gt;
      &lt;div class="col-lg-1 text-center"&gt;
          &lt;span class="glyphicon glyphicon-trash" data={{event.id}} ng-click="deleteEvent()"&gt;
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$scope.deleteEvent=function(){
      console.log(this);
  }
  </code></pre>
  
  <p>I need to get the value in data attribute in the controller function. I tried using this keyword and $event; neither one worked.</p>
  
  <p>Please help.</p>