this is slightly different to the other questions on stack in that, I need to call my controller's functions with parameters that exist exclusively in my directive.
directive (markup):
<div do-something="doSomething(x)"></div>
directive (js):
var directive = function () {
return {
restrict: 'EA',
templateUrl: '/angular/node-for-detail.html',
scope: {
doSomething: '&'
}
}
};
markup inside directive:
<span ng-click="doSomething('im not resolving')"></span>
function inside controller:
$scope.doSomething = function(myVar) { //myVar is null };
So the problem is, inside the directive param.abs resolved fine, but then, inside the called scope function the parameters are null! What am I doing wrong? How can I get the parameter to make it through?