且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在引用的调用控制器功能Angularjs元素

更新时间:2023-11-21 10:21:22

您可以通过 $事件的功能,并从找出事件的目标

You could pass the $event to the function, and figure out the target of the event from that:

<input type="text" ng-model="cntrlr.inpt" ng-blur="cntrlr.blurr($event)" />
<input type="text" ng-model="cntrlr.second" ng-blur="cntrlr.blurr($event)" />

$scope.blurr = function(event){
    var $this = $(event.target);
    console.log($this);
};