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

Commit 6082e2a

Browse files
SAFADcaitp
authored andcommitted
docs(ngMock): document method ngMock.$interval#cancel()
I have been looking around and was not able to find any informations on how to clear the $interval but reading the source code, sharing is caring! Closes #6367
1 parent 39bae62 commit 6082e2a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/ngMock/angular-mocks.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,17 @@ angular.mock.$IntervalProvider = function() {
491491
nextRepeatId++;
492492
return promise;
493493
};
494-
494+
/**
495+
* @ngdoc method
496+
* @name $interval#cancel
497+
* @description
498+
*
499+
* Clears the interval.
500+
*
501+
* @param {promise} The promise of the interval to cancel.
502+
*
503+
* @return {boolean}
504+
*/
495505
$interval.cancel = function(promise) {
496506
if(!promise) return false;
497507
var fnIndex;

0 commit comments

Comments
 (0)