You can pass the $event
object as an argument when calling the function.
The $event
object contains the browser‘s event object:
<div ng-app="myApp" ng-controller="myCtrl"><h1 ng-mousemove="myFunc($event)">Mouse Over Me!</h1><p>Coordinates: {{x + ‘, ‘ + y}}</p></div><script>var app = angular.module(‘myApp‘, []);app.controller(‘myCtrl‘, function($scope) { ???$scope.myFunc = function(myE) { ???????$scope.x = myE.clientX; ???????$scope.y = myE.clientY; ???}});</script>
$event Object angularjs
原文地址:https://www.cnblogs.com/duanwandao/p/9974900.html