Popup: ng-click fires twice


#1

I have implemented some popups in my app with $ionicPopup. Inside my popup I have a div element with ng-click that calls a function in my controller.

When I click on this div element on my android device, the ng-click fires twice sometimes. For example when I touch the button twice very fast. I also have some normal buttons in my popups and I got the same behaviour.

This problem does not occur outside of the popups in my app.

Any ideas?


#2

Put the working the minimal piece of code to codpen, so could have better chance of sorting this out.


#3

@Florian_ Maybe you are using ng-init=“yourControllerFunction()” in the View or you have a Route $state configuration in your app.js witch also point to your controller? It will fire twice the click-event and I did this mistake a while ago.


#4

Thanks for the idea, but I don´t think that this is the problem, because I do not use ng-init and I got the same problem on Codepen.

Here is a simple CodePen for the problem:

Try to click fast on the back button and you will see that the counter is incremented twice.


#5

Check if you are running a loop or you have more than one button with same ng-model value


#6

Thanks for your reply, but as you can see in the CodePen, there is no loop or butttons with the same ng-model value.


#7

I’ve tested it on Android 5.1.1 nad its ok. Have you tried on-tap?


#8

Thanks for the advise. I have tried on-tap, but I got multiple click events with this too.


#9

Any other ideas on this?