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