Reputation: 41
In this code event display undefined.
<div class="div1" ng-click="displayinfo(event)">
sadfasf
</div>
$scope.displayinfo = function(event)
{
alert(event);
}
can anyone help. thanks
Upvotes: 2
Views: 11730
Reputation: 12427
Use $event instead of event. It is little hidden in the docs http://docs.angularjs.org/api/ng.directive:ngClick
Upvotes: 4
Reputation: 159105
Very close--but it's $event
.
<div class="div1" ng-click="displayinfo($event)">
sadfasf
</div>
$scope.displayinfo = function(event)
{
alert(event);
}
Upvotes: 2