문제

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.

도움이 되었습니까?

해결책

Angular's interval Service

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top