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

Commit 7d70dcd

Browse files
olexmepetebacondarwin
authored andcommitted
docs($animate): fix misleading $animate.cancel example
The given example is wrong, you can't cancel the promise returned by "then" since it is not the one originally tracked by "addClass". Closes #10498
1 parent 9e6161e commit 7d70dcd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngAnimate/animate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,8 @@ angular.module('ngAnimate', ['ng'])
833833
* promise that was returned when the animation was started.
834834
*
835835
* ```js
836-
* var promise = $animate.addClass(element, 'super-long-animation').then(function() {
836+
* var promise = $animate.addClass(element, 'super-long-animation');
837+
* promise.then(function() {
837838
* //this will still be called even if cancelled
838839
* });
839840
*

0 commit comments

Comments
 (0)