I tried this modified version of jquery function:
$scope.link_clicked = function(e) {
if (e.button == 0) {
$("#spinner_bg").css("display", "block");
}
};
But it gives error: "Cannot read property 'button' of undefined..." :/
I tried this modified version of jquery function:
$scope.link_clicked = function(e) {
if (e.button == 0) {
$("#spinner_bg").css("display", "block");
}
};
But it gives error: "Cannot read property 'button' of undefined..." :/
You need to pass in the $event object: ng-click=link_clicked($event) like JSFiddle.
The JS code:
angular.module('Joy', [])
.controller('JoyCtrl', ['$scope', function ($scope) {
$scope.link_clicked = function (e) {
console.log(e);
};
}]);