This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +19
-1
lines changed
2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -670,7 +670,7 @@ function $LocationProvider(){
670
670
// http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx
671
671
var href = elm . attr ( 'href' ) || elm . attr ( 'xlink:href' ) ;
672
672
673
- if ( href . indexOf ( '://' ) < 0 ) { // Ignore absolute URLs
673
+ if ( /*href &&*/ href . indexOf ( '://' ) < 0 ) { // Ignore absolute URLs
674
674
var prefix = '#' + hashPrefix ;
675
675
if ( href [ 0 ] == '/' ) {
676
676
// absolute path - replace old path
Original file line number Diff line number Diff line change @@ -39,4 +39,22 @@ describe('event directives', function() {
39
39
expect ( $rootScope . formSubmitted ) . toEqual ( 'foo' ) ;
40
40
} ) ) ;
41
41
} ) ;
42
+
43
+
44
+ describe ( 'ngClick' , function ( ) {
45
+ // Regression (gh-7721)
46
+ it ( 'should be evaluated on anchor elements with no href in html5 mode' , function ( ) {
47
+ module ( function ( $locationProvider ) {
48
+ $locationProvider . html5Mode ( true ) ;
49
+ } ) ;
50
+ inject ( function ( $rootScope , $compile ) {
51
+ $rootScope . i = 0 ;
52
+ element = $compile ( '<a ng-click="i = i + 1">anchor</a>' ) ( $rootScope ) ;
53
+
54
+ browserTrigger ( element ) ;
55
+
56
+ expect ( $rootScope . i ) . toBe ( 1 ) ;
57
+ } ) ;
58
+ } ) ;
59
+ } ) ;
42
60
} ) ;
You can’t perform that action at this time.
0 commit comments