如何检索angularjs中被点击的ElementId?

How to retrieve the clicked ElementId in angularjs?

我有以下行:

<a href="#" id="12345" data-ng-click="ShowId()">

在我的控制器中我有:

$scope.ShowId = function(){
     alert('clicked element id in here: 12345');
};

如何在我的控制器 ShowId 函数中访问被点击元素的 ID,在我的例子中是 12345?

注意绑定不在 ng-repeat 中,所以我可以访问项目 ID 或类似的东西。

我解决了这个问题:

<a href="#" id="12345" data-ng-click="ShowId($event)">   

$scope.ShowId = function(event)
{
   alert(event.target.id);
};
<button data-id="101" ng-click="showDetail($event)">click Me</button>

$scope.showDetail = function(event)
{
  console.log($(event.target).attr("data-id"));
}