Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
17
rated 0 times [  20] [ 3]  / answers: 1 / hits: 24577  / 11 Years ago, sat, december 21, 2013, 12:00:00

This Plunkr has 2 links. The one on the left side is using the ng-click directive with the on angular-touch module inserted. As said in the angular touch module description for ng-click, the ng-click link should not have a 300ms delay. But if you test it on mobile devices, this is still the case.



So is plunkr preventing the correct functionality because its executed in an iFrame or something like that or is it required to insert Fastclick.js into the project for the directive to work correctly ? I don't get it, please help.



Example: http://plnkr.co/NRRrmMFaIKg2zLu5C1Tg



edit: the example in the angularjs docs ist not working either. They didn't even inserted the angular-touch module.


More From » angularjs

 Answers
32

Because angulars ngTouch module is only removing the 300ms delay on ng-click directives, i'm using fastclick.js now which harmonates perfectly fine with angular.



At the beginning it did not work for me, because I attached the Fastclick library before its script was loaded, before the DOM was ready. I fixed this by wrapping the function in the run block of my angular app. This function executes code after the DOM is ready.



angular.module('myModule', []).
run(function() {
FastClick.attach(document.body);
});


This way is suggested by the latest screencast on the angularjs youtube channel.


[#73620] Thursday, December 19, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
renag

Total Points: 22
Total Questions: 97
Total Answers: 95

Location: Albania
Member since Sun, Nov 22, 2020
4 Years ago
;