Skip to content

Commit 777f3c1

Browse files
committed
Merge pull request #228 from kujtimiihoxha/kujtimiihoxha-patch1
For #227
2 parents 37bca9b + cf154ac commit 777f3c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

angular/run/routes.run.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
export function RoutesRun($rootScope, $state, $auth) {
22
'ngInject';
33

4-
$rootScope.$on("$stateChangeStart", function(event, toState) {
4+
5+
var deregisterationCallback = $rootScope.$on("$stateChangeStart", function(event, toState) {
56

67
if (toState.data && toState.data.auth) {
78
/*Cancel going to the authenticated state and go back to landing*/
@@ -12,4 +13,5 @@ export function RoutesRun($rootScope, $state, $auth) {
1213
}
1314

1415
});
16+
$rootScope.$on('$destroy', deregisterationCallback)
1517
}

0 commit comments

Comments
 (0)