@@ -11,15 +11,18 @@ angular.module('angularWidget', ['angularWidgetInternal'])
11
11
//an internal route changes, effecting only the router inside that view.
12
12
$provide . decorator ( '$rootScope' , function ( $delegate , $injector ) {
13
13
var next , last , originalBroadcast = $delegate . $broadcast ;
14
+ var lastAbsUrl = '' ;
14
15
15
16
//sending $locationChangeSuccess will cause another $routeUpdate
16
17
//so we need this ugly flag to prevent call stack overflow
17
18
var suspendListener = false ;
18
19
19
20
function suspendedNotify ( widgets , $location ) {
20
21
suspendListener = true ;
21
- widgets . notifyWidgets ( '$locationChangeStart' , $location . absUrl ( ) , '' ) ;
22
- widgets . notifyWidgets ( '$locationChangeSuccess' , $location . absUrl ( ) , '' ) ;
22
+ var absUrl = $location . absUrl ( ) ;
23
+ widgets . notifyWidgets ( '$locationChangeStart' , absUrl , lastAbsUrl ) ;
24
+ widgets . notifyWidgets ( '$locationChangeSuccess' , absUrl , lastAbsUrl ) ;
25
+ lastAbsUrl = absUrl ;
23
26
suspendListener = false ;
24
27
}
25
28
@@ -91,7 +94,7 @@ angular.module('angularWidgetOnly', [])
91
94
. run ( function ( $rootScope , $location ) {
92
95
//widget - since $location is shared and is not going to be instantiated
93
96
//by the new injector of this widget, we send the $locationChangeSuccess
94
- //ourselves to kickoff ng-rounte and ui-router ($location usually does that
97
+ //ourselves to kickoff ng-route and ui-router ($location usually does that
95
98
//itself during instantiation)
96
99
$rootScope . $evalAsync ( function ( ) {
97
100
var ev = $rootScope . $broadcast ( '$locationChangeStart' , $location . absUrl ( ) , '' ) ;
0 commit comments