Ng-click in android calls twice


#1

$scope.sendReply = function(event) {
console.log(event);
event.stopPropagation();
alert(“came”)
)};


#2

What version of Ionic are you using, what version of android are you using?


#3

i am using android version 4.2 and latest ionic beta version


#4

You should need the event.stopPropagation(); line in your function, I wasn’t even able to get things to fire off with it in there. This is how I had it set up in my example and things were working well. Give it a try on your side

 angular.module('ionicApp', ['ionic'])

.controller('MyCtrl', function($scope) {
  
 $scope.alert = function(event) {
console.log(event);
alert("came")
};
  
});

#5

I am having the same issue here:

<p ng-if="post.picture.liked" ng-disabled="processing" ng-click="unLike(post.picture)" class="product-like"><i class="icon ion-heart"></i>Unlike</p> <p ng-if="!post.picture.liked" ng-disabled="processing" ng-click="Like(post.picture)" class="product-like"><i class="icon ion-heart"></i>Like</p>


#6

Make sure you aren’t declaring your controller twice for that view.