Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic which is faster ng-click or on-tap

Which is faster in Ionic on a mobile device on-tap or ng-click. To me they seem pretty similar however 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>
like image 830
svnm Avatar asked Oct 28 '14 11:10

svnm


People also ask

Is ionifits a Zenefits for angular performance?

The following post reviews Stephen’s Angular performance tips applied through the lens of an Ionic app, Ionifits, a Zenefits-inspired human resources demo app. It showcases various Ionic App Platform technologies, including Ionic Framework, Capacitor, and Ionic Native Enterprise solutions.

Will Ionic 4 be faster than ionic 3?

Ionic 4 would be faster than Ionic 3 (quite significant improvements were made) and generally every new framework version comes with some form of improvements. But, Ionic 3 already was fast (as was Ionic 2, and even the original Ionic built on AngularJS).

What is ng-click in AngularJS?

Definition and Usage. The ng-click directive tells AngularJS what to do when an HTML element is clicked.

What is lazy loading in ionic angular?

Ionic Angular apps embrace lazy loading out of the box, so no changes to Ionifits were necessary. New Ionic apps (created using the ionic start command) are pre-configured with lazy loading, and subsequent app pages created using the Ionic CLI’s generate command are automatically configured as lazy loaded modules, too.


1 Answers

Both should be pretty equal, because a tap can only be determined based on how long the touch event occurs. I did something like this below and had the methods console.log when they fired the callback. I see the tap is going first, but click is happening at the same time in my test.

<button class="button" on-tap="onTap()" ng-click="onClick()">Hit me</button>
like image 89
Jeremy Wilken Avatar answered Oct 21 '22 04:10

Jeremy Wilken