yodalr yodalr - 20 days ago 9
AngularJS Question

AngularJS: Error: event is undefined (Firefox only)

Even though I'm defining the event and it works in Chrome it does not work in Firefox?

app.controller('lightbox_close_controller', ['$scope', '$rootScope', function($scope, $rootScope) {

$scope.close_rating_lightbox = function(event) {

if (!$(".lightbox").hasClass("mobile_ratebox")) {
event.stopPropagation();
$("#image_in_lightbox_inside").empty();
}
}
}

]);

Answer

Pass $event from ui

like

<button ng-click="close_rating_lightbox($event)">Click Me</button>
Comments