0

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.

1 Answer 1

3

Angular's interval Service

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.