I am wondering how to specify when the link function for a directive should be called.
Currently I have the following code:
<my-directive username="abc"></my-directive>
module.directive("myDirective", [{
restrict: "A",
link($scope, element, others) {
//if element.clicked() {
// console.log("you clicked me");
//}
}
}]);
As you can see I have commented out pseudo-ish code of what I would like to do and I have seen that it's possible to do something like element.onClick = function() {}. But this still doesn't seem to be called when the element is clicked.
Thanks