Marcos
Marcos

Reputation: 63

AngularJS - Updating variable every second

What is the best way to update a variable every second?

What I want is that when the user clicks on a button, it will make variable x be updated (added 1, for example) every second.

Upvotes: 0

Views: 608

Answers (1)

SnareHanger
SnareHanger

Reputation: 928

Angular's interval Service

Angular's wrapper for window.setInterval. The fn function is executed every delay milliseconds.

Upvotes: 3

Related Questions