I do this kind of all the time and I'm not too sure it works. If it does, How can I check? If it doesn't whats a better method of canceling a timeout after it's completed?
var delay = $timeout(function() {
for (i = 0; i < allHighlightedEls.length; i += 1) {
//... some transformations
}
}, 1000)
.then(function() {
$timeout.cancel(delay);
});