Difference between ng-click and on-touch in ionic structure 1

which selects event best on ionic HTML page?

I developed an ionic framework. I used ng-click and touch on the HTML page.

ng-click code:

<ion-floating-button ng-click ="vm.addExpense()" has-footer="false" icon="ion-plus" iconColor="#fff"> 

code:

 <ion-floating-button on-touch="vm.addnewCharge()" has-footer="false" button-color="rgb(84, 44, 99)" icon="ion-plus" iconColor="#fff"> 

+5
source share
2 answers

The difference according to the documents is that on-touch works immediately when touched and does not wait for a release event.

Called immediately when the user first clicks. This gesture does not wait for a touch / mouse.

Here's a link to the docs: http://ionicn.com/docs/nightly/api/directive/onTouch/

ng-click is by far the best choice.

+1
source

ng-click is a way to go with ionic, and it will take care of a 300 ms delay. Ionic developers have put a lot of effort into this to be so simple.

Therefore, there is no need to use an external ngTouch module

http://ionicframework.com/blog/ionic-huge-update/431 - see paragraph with Adamclick!

0
source

Source: https://habr.com/ru/post/1274590/


All Articles