Skip to content

Instantly share code, notes, and snippets.

@cmertayak
Created July 23, 2013 21:14
Show Gist options
  • Save cmertayak/6066234 to your computer and use it in GitHub Desktop.
Save cmertayak/6066234 to your computer and use it in GitHub Desktop.
Javascript update based on a timer
// schedule update in one second
function updateLater() {
// save the timeoutId for canceling
timeoutId = $timeout(function() {
updateTime(); // update DOM
updateLater(); // schedule another update
}, 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment