例:
<div ng-app="miniapp">
<div ng-controller="Ctrl">
<a ng-click="clickEvent($event)" class="exampleClass" id="exampleID" data="exampleData" >Click Me</a>
</div>
</div>
var $scope;
var app = angular.module('miniapp', []);
function Ctrl($scope) {
$scope.clickEvent = function(obj) {
console.log(obj);
alert(obj.target.getAttribute("data"));
alert(obj.target.attributes.data.value);
alert(obj.target.getAttribute("id"));
alert(obj.target.attributes.id.value);
}
};