I have a directive which has a link function something like:
scope: {
target: '@',
fooFunction: '&'
},
link:
scope.$apply(attrs.fooFunction);
var fooValue= scope.fooFunction(data,scope.target);
in my controller i have defined this function as :
$scope.fooFunction= function (data, target) {
//some code here
}
When I use this in the html, I write like this:
<div some-directive foo-Function="fooFunction(ctrl.data,'hardCoded')" target="actualValue"></div>
where I am using myController as ctrl.
My question is that even when I am passing the value as scope.target it always picks the hardCoded value. Is there any way I can pass the value from the scope.target instead of the hard coded value?