Stopping a Timeout when the controller changes

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

Meta

Created:

Updated: 2015-12-15 23:12

References