简体   繁体   中英

Using ui-router with ngTouch

I'm making an Angular.js site using UI-Router. However I also need ngTouch to eliminate the 300ms touch delay on devices..

Ui-router recommends you use the ui-sref directive to navigate. ngTouch only affects ngClick.

Is there a recommended way to fix this? A new directive? A scope function that calls $state.go?

I ended up using hammerjs for handling touch events.

Angular-hammer https://github.com/dreame4/angular-hammer

Hammerjs website

These are the mobile sites we are currently using hammerjs + angular:

Site 1 and Site 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM