Skip to content
Permalink
Browse files

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
  • Loading branch information
olexme authored and petebacondarwin committed Dec 17, 2014
1 parent 9e6161e commit 7d70dcdab164cbbb72861ba0be4fdff17ce4b0b1
Showing with 2 additions and 1 deletion.
  1. +2 −1 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
* });
*

0 comments on commit 7d70dcd

Please sign in to comment.
You can’t perform that action at this time.