Skip to content Skip to sidebar Skip to footer

How Do I Use Event In Angularjs With Firefox As It's Saying That Event Is Undefined?

Here's my Angular function which basically updates data when you double-click on the required field, change it's value and press enter: $scope.contentEdit = function(data, event)

Solution 1:

Do you use a ng-dblclick directive? If yes, I suppose you has a syntax error.

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.contentEdit = function(data, event) {
        console.log(event);
    };
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
    <div ng-dblclick="contentEdit(1, $event)">dblclick me to see the console</div>
</div>

Post a Comment for "How Do I Use Event In Angularjs With Firefox As It's Saying That Event Is Undefined?"