javascript - Does canceling a $timeout in the following 'then' function work? -
i kind of time , i'm not sure works. if does, how can check? if doesn't whats better method of canceling timeout after it's completed?
var delay = $timeout(function() { (i = 0; < allhighlightedels.length; += 1) { //... transformations } }, 1000) .then(function() { $timeout.cancel(delay); });
after completed, completed. there nothing left cancel.
calling cancel on nothing.
Comments
Post a Comment