javascript - How can I make a function that calls another function every 60 seconds? -


i have function:

isauthenticated = (): boolean => {     xxx }; 

i using angularjs , know how can make function such

keepcheckingauthentication() 

that call authenticated() function every 60 seconds?

you can use $interval function (wrapper of window.setinterval() in angularjs)?

the documentation of $interval function here

in case keepcheckingauthentication() function , can adjust other parameters accoding needs? help?

example:

$interval(myfunctionatinterval, 5000) // scheduled every 5 seconds, instance  funtion myfunctionatinterval() {...} 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -