Make sure we cleanup polling timers on view switch
This commit is contained in:
@@ -770,7 +770,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|
||||
|
||||
$scope.ready = true;
|
||||
|
||||
$interval(function () { refreshApp(); }, 5000); // call with inline function to avoid iteration argument passed see $interval docs
|
||||
var refreshTimer = $interval(function () { refreshApp(); }, 5000); // call with inline function to avoid iteration argument passed see $interval docs
|
||||
$scope.$on('$destroy', function () {
|
||||
$interval.cancel(refreshTimer);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user