哆啦的时光机
可以通过指令传入参数$event,然后函数接受ev,当你点击节点的时候,通过获取事件源对象(ev.target)来当做this。具体代码如下:<body ng-controller="MyCtrl"><div class="div1" ng-click="clickFn($event)"></div><script src="js/angular.min.js"></script><script type="text/javascript">var myApp = angular.module('myApp',[]);myApp.controller('MyCtrl',['$scope','$rootScope',function($scope,$rootScope){$scope.clickFn = function(ev){console.log(ev.target);};}]);</script></body>