From cf66e8262343c4041c6a2f0ba2b139f9b05ce429 Mon Sep 17 00:00:00 2001 From: olexme Date: Wed, 17 Dec 2014 11:07:08 +0100 Subject: [PATCH] docs($animate): misleading $animate.cancel example The given example is wrong, you can't cancel promise returned by "then" but you can do it for promise returned by "addClass". --- src/ngAnimate/animate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ngAnimate/animate.js b/src/ngAnimate/animate.js index fe2fd078baa0..7c6a59d7be7e 100644 --- a/src/ngAnimate/animate.js +++ b/src/ngAnimate/animate.js @@ -833,7 +833,8 @@ angular.module('ngAnimate', ['ng']) * promise that was returned when the animation was started. * * ```js - * var promise = $animate.addClass(element, 'super-long-animation').then(function() { + * var promise = $animate.addClass(element, 'super-long-animation'); + * promise.then(function() { * //this will still be called even if cancelled * }); *