$interval

John Lindquist
InstructorJohn Lindquist

Share this video with your friends

Send Tweet

$interval provides an excellent service for timed operations in your AngularJS apps. It has the advantage over setInterval in "normal" Javascript in that it is aware of Angular's view cycles, as well as being mockable for unit tests. Additionally, it returns a promise and provides a lot of flexibility.