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?