Linc Abela Linc Abela - 1 year ago 75
Javascript Question

AngularJS: Track the time spent in the web app then trigger an event on specific time

I want to track the time the user use the website and then I need to raise an event when the user have been on the site for 30 seconds. Any idea on how to do this?

Answer Source

Why not use Angular's built in $timeout

$timeout(function raiseEvent(){
   //do something here
}, 30000)