AngularJS $event Object > 퍼블리싱강좌

퍼블리싱강좌

AngularJS $event Object 정보

AngularJS AngularJS $event Object

본문

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>
추천
0
  • 복사

댓글 0개

© SIRSOFT
현재 페이지 제일 처음으로