Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS $event Object as Parameter Example
Keywords : How to pass $event as parameter to event listeners example, Angularjs event with parameter example, Angularjs send / pass $event object as parameter example
Example
<!DOCTYPE html> <html> <head> <title> AngularJs $event Object as Example </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type="text/javascript"> var app = angular.module('eventsApp', []); app.controller('eventsCtrl', function ($scope) { $scope.getdetails = function (eveparam) { $scope.result = "Your Clicked on Coordinates X: " + eveparam.clientX + " and Y: " + eveparam.clientY; } }); </script> <style type="text/css"> .divstyle { padding:20px; border:1px solid black; width:30%; font-weight:bold; background-color:#2b8bc0; color:White; cursor:pointer; } </style> </head> <body> <div ng-app="eventsApp" ng-controller="eventsCtrl"> <h2>AngularJs $event Object as Parameter Example</h2> <div class="divstyle" ng-click="getdetails($event)"> Click on this Div We will show Coordinates Where you clicked </div><br /> <span style="color:Red">{{result}}</span> </div> </body> </html>
Click Here to See Result
Result
Previous
Next