I've setup a controller to tick every few seconds, which in turn makes a restful call to a backend api. Everything is working as expected, except when I navigate to another section (handled by a separate controller), the tick continues to fire.
Is it possible to remove the controller from scope entirely?
Here's a paste of my current controller:
myApp.controller('SupervisorController', function($scope, supervisord, $timeout) {
$scope.supervisord = supervisord;
(function tick() {
$scope.supervisord.fetch();
$timeout(tick, 2500);
})();
});