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

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -