**Context**

I m actually developping an application in which I need to generate directive dynamically from a controller to a view (drag n drop system).

It works like this :

*the directive*

```
angular.module('app')
    .directive('dynamic', function ($compile) {
        return {
            restrict: 'A',
            replace: true,
            link: function (scope, ele, attrs) {
                scope.$watch(attrs.dynamic, function (html) {
                    ele.html(html);
                    $compile(ele.contents())(scope);
                });
            }
        };
    });

```

*And in the controller, it looks like :*

```
$scope.listModules = [
            {libelle: "Utilisateurs connectés", template: "<div user-connecte></div>", drag: true}
]

```

*And in the HTML file :*

```
<div ng-repeat="currentModule in listModules" dynamic="currentModule.template">
The directive loaded
</div>

```

**The problem**

I want to use the 

```
$scope.$emit('event');

```

from my controller, to send some information to my directive, which is supposed to get it with :

```
$scope.$on('event',function(){console.log('yiihaaa');})

```

It seems that it doesnt happen anything...

I need the log to be displayed.

Can you help me ?

Thanks for advance