From 1502065a42422a97993a0e2c797635021136eb42 Mon Sep 17 00:00:00 2001 From: Sadaoui Abderrahim Date: Thu, 20 Feb 2014 06:03:32 -0800 Subject: [PATCH] Add documentation to $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! --- src/ngMock/angular-mocks.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index a9593e587dae..96b03f54a34b 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -491,7 +491,17 @@ angular.mock.$IntervalProvider = function() { nextRepeatId++; return promise; }; - + /** + * @ngdoc method + * @name $interval#cancel + * @description + * + * Clears the interval. + * + * @param {promise} The promise of the interval to cancel. + * + * @return {boolean} + */ $interval.cancel = function(promise) { if(!promise) return false; var fnIndex;