This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -752,9 +752,8 @@ function $LocationProvider(){
752
752
* window events (or polling if events aren't supported), but those methods are
753
753
* async. For this reason, $browser.url() will perform a comparison with each call
754
754
* to the method as a getter.
755
- * NOTE: Method does not exist on mock $browser
756
755
*/
757
- if ( $browser . urlChangedOutsideAngular && $browser . urlChangedOutsideAngular ( ) ) {
756
+ if ( $browser . urlChangedOutsideAngular ( ) ) {
758
757
$location . $$parse ( browserUrl ) ;
759
758
$browser . urlChangedOutsideAngular ( false ) ;
760
759
}
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ angular.mock.$Browser = function() {
35
35
self . $$url = "http://server/" ;
36
36
self . $$lastUrl = self . $$url ; // used by url polling fn
37
37
self . pollFns = [ ] ;
38
+ self . $$hasChangedOutside = false ;
38
39
39
40
// TODO(vojta): remove this temporary api
40
41
self . $$completeOutstandingRequest = angular . noop ;
@@ -68,6 +69,16 @@ angular.mock.$Browser = function() {
68
69
return self . deferredNextId ++ ;
69
70
} ;
70
71
72
+ self . urlChangedOutsideAngular = function ( hasChanged ) {
73
+ if ( isDefined ( hasChanged ) ) {
74
+ self . $$hasChangedOutside = hasChanged ;
75
+ return self ;
76
+ }
77
+ else {
78
+ return self . $$hasChangedOutside ;
79
+ }
80
+ } ;
81
+
71
82
72
83
/**
73
84
* @name $browser#defer.now
You can’t perform that action at this time.
0 commit comments