How to set timer for a button function


#1

Hello guys,

I’m trying to create a button which fires every 1 minute once it’s clicked on.
How can I do this on angular 5 typescript?

Thanks,


#2

setTimeout is your friend
–> https://www.w3schools.com/jsref/met_win_settimeout.asp


#3

Thanks, yes, that would work!

But if you guys know any hidden property of angular which does this, please let me know as well.


#4

No, no such thing exists in Angular.


#5

You might want to mark this thread as solved.
This is easier for other people with the same problem in the future.


#6

Problem solved!
Thanks,


#7

setTimeout is the way to go, or use the RxJs interval function.