码迷,mamicode.com
首页 > Web开发 > 详细

$event Object angularjs

时间:2018-11-17 19:06:11      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:contain   cal   div   you   control   nbsp   eve   object c   call   

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

标签:contain   cal   div   you   control   nbsp   eve   object c   call   

原文地址:https://www.cnblogs.com/duanwandao/p/9974900.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!