Ionic, which is faster than ng-click or on-tap

What happens faster in Ionic on a mobile device when pressed or ng-click. To me, they seem pretty similar, but onClick is much slower.

codepen

<button class="button button-light button-dark" on-tap="onTap()">tap</button> <button class="button button-light button-dark" ng-click="onClick()">click</button> 
+7
ionic-framework
source share
1 answer

Both should be fairly equal, because the tap can only be determined depending on the duration of the touch event. I did something like this below and had console.log methods when they launched the callback. I see that the crane goes first, but the click occurs simultaneously in my test.

 <button class="button" on-tap="onTap()" ng-click="onClick()">Hit me</button> 
+11
source share

All Articles