Stopping a Timeout when the controller changes

var promise = $timeout(someUpdateFunction, 2000);
    
$scope.$on('$destroy', function(){
    $timeout.cancel(promise);
});

Meta

Created:

Updated: 2013-08-15 14:08

References