0

I want to pass a function that returns a promise into my directive. Currently I am doing as follows:

Callback created in parent controller:

$scope.myCb = function(data) {
   console.log(data);
}

Scope of Directive:

scope {
    dataCallback: "&"
}

It is being passed to the directive as follows:

<my-directive data-callback="createCallback"></div>

And it is being called in the directive controller as follows:

$scope.dataCallback(data)

where data is a local variable.

Currently this is not working. The $scope.dataCallback is returning parentGet(scope, locals) and is not executing any of the code inside of the function.

Can anyone help point me in the right direction?

https://plnkr.co/edit/ycgFpurlt2MFupPI1LZJ?p=preview

Shawn
  • 667
  • 8
  • 19

1 Answers1

1

Solved:

Can not use data as start of directive property.

Shawn
  • 667
  • 8
  • 19