I am using AngularJS and am trying to pass a function on my controller's scope to a directive's isolate scope.
I know I have done this before, but am having issues this time.
The function takes two inputs, and logs them to the console.
However, when I pass it to my directive as
<div my-dir my-function="functionName"></div>
or
<div my-dir my-function="functionName()"></div>
And attempt to call it from my directives controller, I actually get a function that takes no arguments and returns my function.
that is, instead of calling
ctrl.functionName(a,b)
I have to call
ctrl.functionName()(a,b)
Any help would be greatly appreciated.
I have seen some reference to syntax like this:
<div my-dir my-function="functionName({})"></div>