top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to handle mobile browsers/devices events in AngularJS?

0 votes
395 views
How to handle mobile browsers/devices events in AngularJS?
posted Nov 27, 2017 by Latha

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Mobile browsers/devices deal with events differently than desktop browsers. The AngularJS provide
ngTouch library (angular-touch.js) to detect mobile browsers/devices events.
For example, Mobile browsers detect a tap event and then wait for second event about 300 ms if any. So if we’re
double-tapping the device then after this delay the browser fires a click event.
In this way this delay can make our apps unresponsive. Hence, instead of dealing with the click event, we can
detect touch event using ngTouch library. It handles touch detection for us through the ng-click directive. Hence
it will take care of calling the correct click event for mobile.

<button ng-click="save()">Save</button>
answer Nov 27, 2017 by Shivaranjini
...