Looking to fetch data from a webapi in the background using either the $timeout or $interval service in Angular JS.
I have some concerns about how the $timeout and $interval services work. I've run into issues when incorporating these services into my controller. Here are some observations from my current development: - There is a presence of multiple nested controllers within the application. - Upon transitioning from one state to another, the $timeout or $interval service is triggered again. (This can be prevented by cancelling the timer on Scope Destroy) - However, how do we go about maintaining timer information?
Is it possible to create a service or factory to address this issue?