Angular, UI-router. Using $interval in a controller of a state like so:
$scope.Timer = null; $scope.startTimer = function () { $scope.Timer = $interval($sc
clear interval on $destroy
Like this
$scope.$on("$destroy",function(){ if (angular.isDefined($scope.Timer)) { $interval.cancel($scope.Timer); } });