I have a question regarding executing a function (defined inside a controller) from a directive, but with another directive between these two (so this directive just passes forward the function). I made a quick working example, but I think it's not the best solution to my problem:
http://plnkr.co/edit/mS8Oea?p=preview
Here's the code:
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
<title>AngularJS Plunker</title>
<script>document.write('<base href="' + document.location + '" />');</script>
<link rel="stylesheet" href="style.css" />
<script data-require="[email protected]" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js" data-semver="1.0.8"></script>
<script src="app.js"></script>
</head>
<body ng-controller="MainCtrl">
<div agg-events="" fn="ctrlFn(par1, par2)"></div>
</body>
</html>
If someone knows how to do this in a better way, it would be very helpful to me. Thanks :)