136
rated 0 times
[
143]
[
7]
/ answers: 1 / hits: 139375
/ 11 Years ago, sat, august 3, 2013, 12:00:00
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.
More From » angularjs