Stopping a Timeout when the controller changes
var promise = $timeout(someUpdateFunction, 2000);
$scope.$on('$destroy', function(){
$timeout.cancel(promise);
});
Meta
Author: Philip W. Sorst
Created: 2013-08-15 14:08
Updated: 2015-12-15 23:12