我在 ng-click 上有多个具有相同回调的元素:
<button ng-click="doSomething()"></button>
<button ng-click="doSomething()"></button>
<button ng-click="doSomething()"></button>
<button ng-click="doSomething()"></button>
// In controller:
$scope.doSomething = function() {
// How do I get a reference to the button that triggered the function?
};
如何获取对调用 doSomething 的对象的引用?(我需要从中删除一个attr)