@@ -48,8 +48,8 @@ ngTouch.config(['$provide', function($provide) {
48
48
} ] ) ;
49
49
} ] ) ;
50
50
51
- ngTouch . directive ( 'ngClick' , [ '$parse' , '$timeout' , '$rootElement' ,
52
- function ( $parse , $timeout , $rootElement ) {
51
+ ngTouch . directive ( 'ngClick' , [ '$parse' , '$timeout' , '$rootElement' , '$location' ,
52
+ function ( $parse , $timeout , $rootElement , $location ) {
53
53
var TAP_DURATION = 750 ; // Shorter than 750ms is a tap, longer is a taphold or drag.
54
54
var MOVE_TOLERANCE = 12 ; // 12px seems to work in most mobile browsers.
55
55
var PREVENT_DURATION = 2500 ; // 2.5 seconds maximum from preventGhostClick call to click
@@ -262,6 +262,11 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
262
262
if ( ! angular . isDefined ( attr . disabled ) || attr . disabled === false ) {
263
263
element . triggerHandler ( 'click' , [ event ] ) ;
264
264
}
265
+
266
+ // If the element has an href attribute, ensure that the url gets updated.
267
+ if ( angular . isString ( attr . href ) ) {
268
+ $location . url ( attr . href ) ;
269
+ }
265
270
}
266
271
267
272
resetState ( ) ;
@@ -293,4 +298,3 @@ ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
293
298
294
299
} ;
295
300
} ] ) ;
296
-
0 commit comments