This question presents a unique scenario as it involves calling a controller's functions with parameters that are only accessible within a directive.
Directive (markup):
<div do-something="doSomething(x)"></div>
Directive (JavaScript):
var directive = function () {
return {
restrict: 'EA',
templateUrl: '/angular/node-for-detail.html',
scope: {
doSomething: '&'
}
}
};
Markup inside the directive:
<span ng-click="doSomething('im not resolving')"></span>
Function inside the controller:
$scope.doSomething = function(myVar) { //myVar is null };
The issue here is that while param.abs is resolved correctly within the directive, the parameters appear as null within the called scope function. What could be causing this problem? How can the parameter successfully pass through?