I have a controller like this which is attached to body
of html.
angular.module("app", [])
.controller("MyCtrl", function($scope) {
// Here I perform some jquery code listening for click event
$("a").click(function() {
$(this).toggleClass("active");
});
});
Now, I want to know why this doesn't work inside controller. I know, if I put it into directive then it does work.