ng-click不能在平板电脑上工作

时间:2022-10-22 09:11:43

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

我点击了div标签。这适用于每个浏览器的桌面。但是,当我在iPad(ios7)上测试时,我没有工作。奇怪的是。当我将div更改为a-tag时。有用。但这不是一个选择,因为这打破了我的应用程序中的其他东西。

<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 click the div, then the ng-click-active class is added. But the ng-click is not executed.

当我添加ng-touch模块时。然后单击div,然后添加ng-click-active类。但是没有执行ng-click。

1 个解决方案

#1


0  

to run events in tablet and mobile devices, you must integrate this module based hammer.js

要在平板电脑和移动设备中运行事件,您必须基于hammer.js集成此模块

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

Here more information:

这里有更多信息:

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

#1


0  

to run events in tablet and mobile devices, you must integrate this module based hammer.js

要在平板电脑和移动设备中运行事件,您必须基于hammer.js集成此模块

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

Here more information:

这里有更多信息:

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