Im trying to send a message from within a directive to its parent controller (without success)
Here is my HTML
To get { nr: 10 } you should add 2 arguments to listener: event and data:
{ nr: 10 }
event
data
$scope.$on('go', function(event, data){ alert(JSON.stringify(data)); });
(keep in mind that we use $on and not on)
$on
on
Full example in plunker