在移动Safari浏览器调试缓慢角UI路由器状态变化路由器、缓慢、浏览器、状态

2023-09-14 00:10:26 作者:先生是别人家的

我正在写一个角度应用程序,采用了棱角分明的UI路由器来管理国家/路由。

I'm writing an angular app, using angular-ui-router to manage states / routing.

在桌面浏览器(Chrome浏览器/ Safari浏览器),这是工作的罚款。然而,在移动Safari浏览器在iOS 6的iPhone 4上(以及在较小的IOS 7延长iPhone 5)改变状态,通过$ state.go,可以把任何东西到2秒。

On desktop browsers (Chrome / Safari) this is working fine. However, on Mobile Safari on IOS 6 on iPhone 4 (and to a lesser extend on IOS 7 on iPhone 5) changing state, via $state.go, can take anything up to 2 seconds.

我使用ngTouch,所以我不认为它是原生的点击事件发生火灾的300毫秒。 ngClick属性不调用$ state.go现在似乎工作pretty很多瞬间。

I'm using ngTouch, so I don't think that it's the 300ms that the native click event takes to fire. ngClick attributes that don't call $state.go now seem to work pretty much instantaneously.

我如何调试此寻找到的时间被消耗?

How can I debug this to find where the time is being spent?

推荐答案

ngTouch不与UI的SREF指令工作。我们使用 fastclick.js 处理点击行为,并取消ngTouch。的问题是,在指令步骤上的每个人的事件,并实际上不兼容。您可以通过阅读这两个指令的实施看出这一点。

ngTouch doesn't work with the ui-sref directive. We used fastclick.js to handle the click behavior, and removed ngTouch. The issue is that the directives step on each others events, and are in fact incompatible. You can see this by reading the implementation of both directives.