Ng-click does not work on tablet

I have an ng click on a div tag. This works on the desktop in every browser. But when I test it on the iPad (ios7), I do not work. Strange enough. When I change the div to a-tag. It is working. But this is not an option, because it breaks other things in my application.

<div class="ytBlockNativeControles" ng-click="background || YtPlayer.togglePlay();" ng-class='{"pause":YtPlayer.playing == 1, "play":YtPlayer.playing == 0}'> <img src="{{YtPlayer.poster}}" alt="" class="ytPoster" ng-if="YtPlayer.poster != ''"> <div class="ytOverlayPlayBtn imgReplace" ng-show="!YtPlayer.playing && !background && !YtPlayer.initiallyHidePlayBtn">Play</div> </div> 

When I add the ng-touch module. And I press div, then ng-click-active class is added. But ng-click fails.

+6
source share
1 answer

To trigger events on tablet and mobile devices, you must integrate this module based on hammer.js

https://github.com/wzr1337/angular-gestures

Here is additional information:

http://www.ng-newsletter.com/posts/angular-on-mobile.html

0
source

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


All Articles