Linc Abela Linc Abela - 3 months ago 11
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

Why not use Angular's built in $timeout

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