say i have a controller like so (irrelevant code removed for brievity)
app.controller('MyCtrl', [function(){
vm = this
vm.funcA = function(param){
alert("Func a called with " + param);
}
vm.funcB = function(param, callBack){
//do stuff
callBack(param);
}
}])
and in view like so
<div ng-controller = "MyCtrl as myctrl">
<button ng-click = "myctrl.funcB('Hello World', myctrl.funcA)"> Click Me</button>
</div>
running this gives an error "callBack is not a function", i know that there are other ways of achieving the result this tries to achieve but how do you pass a function as a parameter to a controller function in angular?