score:2

Accepted answer

you need to specify the parameter in the call:

so in your directive it should be

function click(d) {
  scope.logNode({d: d})
}

here is an example: http://jsfiddle.net/heavyhorse/7983y06k/

score:1

You may pass a model attaching some methods into the directive but I personally prefer using $.broadcast service to keep my codebase cleaner.

Directive

function click(d) {
   $rootScope.$broadcast('someEvent', d);
 }

Controller

angular.module('gameApp')
   .controller('ConnectionsController', ConnectionsController);

 function ConnectionsController() {
   var vm = this;

   vm.$on('someEvent', function(event, data) {
     console.log(data)
   });
 }

If you still think that passing methods around would make the trick for you, here is a simple example passing a method to the directive via a data model


Related Query