AngularJS $event Object

· 8년 전 · 1474
AngularJS $event Object

$event함수를 호출 할 때 객체를 인수로 전달할 수 있습니다 .

$event객체는 브라우저의 이벤트 객체를 포함 :


<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>
|
댓글을 작성하시려면 로그인이 필요합니다.

퍼블리싱강좌

+
분류 제목 글쓴이 날짜 조회
AngularJS 8년 전 조회 1,486
AngularJS 8년 전 조회 1,292
AngularJS 8년 전 조회 1,314
AngularJS 8년 전 조회 1,302
AngularJS 8년 전 조회 1,436
AngularJS 8년 전 조회 1,321
AngularJS 8년 전 조회 1,547
AngularJS 8년 전 조회 1,277
AngularJS 8년 전 조회 1,168
AngularJS 8년 전 조회 1,250
AngularJS 8년 전 조회 1,788
AngularJS 8년 전 조회 1,491
AngularJS 8년 전 조회 1,598
AngularJS 8년 전 조회 1,224
AngularJS 8년 전 조회 1,475
AngularJS 8년 전 조회 1,580
AngularJS 8년 전 조회 1,560
AngularJS 8년 전 조회 2,204
AngularJS 8년 전 조회 1,601
jQuery Mobile
[jQuery Mobile]
8년 전 조회 2,381
jQuery Mobile
[jQuery Mobile]
8년 전 조회 2,139
jQuery Mobile
[jQuery Mobile]
8년 전 조회 2,016
jQuery Mobile 8년 전 조회 1,919
jQuery Mobile
[jQuery Mobile]
8년 전 조회 1,960
jQuery Mobile
[jQuery Mobile]
8년 전 조회 2,170
jQuery Mobile
[jQuery Mobile]
8년 전 조회 1,703
jQuery Mobile
[jQuery Mobile]
8년 전 조회 1,779
jQuery Mobile 8년 전 조회 1,438
jQuery Mobile
[jQuery Mobile]
8년 전 조회 1,687
jQuery Mobile 8년 전 조회 1,915