Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
fix($interval): when canceling, use clearInterval from $window instea…
Browse files Browse the repository at this point in the history
…d of global scope.

In $interval.cancel, use clearInterval from the $window service instead of from global scope.
The variable clearInterval declared above isn't visible here.
  • Loading branch information
pr4v33n authored and rodyhaddad committed Jun 29, 2014
1 parent 55f99e0 commit f780ccf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/interval.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function $IntervalProvider() {
interval.cancel = function(promise) {
if (promise && promise.$$intervalId in intervals) {
intervals[promise.$$intervalId].reject('canceled');
clearInterval(promise.$$intervalId);
$window.clearInterval(promise.$$intervalId);
delete intervals[promise.$$intervalId];
return true;
}
Expand Down

0 comments on commit f780ccf

Please sign in to comment.