Should ng-click work with img tag ?
myFunction is defined in controller and is $scop
I had this issue in case when I used aliases of angularJS. If I wrote something like this:
function someController($scope) {
var vm = this;
vm.switchSelected = function (passedEvent) {
}
}
and then if in html code to write the following:
then in order to use switchSelected you need write something like this:
so, check did you used
var vm=this;
in your controller. Then you need to add aliasing to your html part.