Ng-click does not work in ionic scroll, even if all $ scope variables are in the object

I created plnkr for this problem. I cannot get ng-click to work on this page. I thought I could solve this problem, with the answers received from this question: Why do I need $ parent to include the function in ng-click when using ion-scroll?

But even when I use all the $scope variables in the object, the function fails.

0
angularjs ionic-framework angularjs-ng-click
source share
2 answers

For some reason (I'm not an ionic developer), Ionic forces <label> swallow all click events. So you need to change this shortcut to something else or put ng-repeat outside of it. I wrote an example in plunker

 <div ng-click="foo()">This one works</div> <label> <div ng-click="foo()">This one doesn't</div> </label> 
+1
source share

Try the following:

 <ion-scroll direction="x"> <div class="icon app-symbol" ng-repeat="image in data.default_images" > <a ng-click="data.setCurrentImage(image)"> <img ng-src="{{ image.src }}" > </a> </div> </ion-scroll> 
0
source share

All Articles