Instead of the default setInterval function, you should use the AngularJS wrapper service $interval
Rule based on Angular 1.x
Styleguide Reference
The following patterns are considered problems;
/*eslint angular/interval-service: 2*/
// invalid
setInterval(function() {
// ...
}, 1000) // error: You should use the $interval service instead of the default window.setInterval method
// invalid
window.setInterval(function() {
// ...
}, 1000) // error: You should use the $interval service instead of the default window.setInterval method
The following patterns are not considered problems;
/*eslint angular/interval-service: 2*/
// valid
$interval(function() {
// ...
}, 1000)
This rule was introduced in eslint-plugin-angular 0.1.0