Looking for a solution to pass a promise-returning function into a directive? Here's what I'm currently doing:
In the parent controller, I've created a callback:
$scope.myCb = function(data) {
console.log(data);
}
Directive Scope:
scope {
dataCallback: "&"
}
This callback is passed to the directive like this:
<my-directive data-callback="createCallback"></div>
And then called in the directive controller as follows:
$scope.dataCallback(data)
However, my current setup isn't working. $scope.dataCallback returns parentGet(scope, locals) and doesn't execute any code within the function. Any guidance on how to fix this?