Use clearInterval from $window instead of global scope.

Use clearInterval from the $window service instead of from global scope.
The variable clearInterval declared above isn't visible here.