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
This commit is contained in:
olexme
2014-12-17 11:07:08 +01:00
committed by Peter Bacon Darwin
parent 9e6161e579
commit 7d70dcdab1

View File

@@ -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
* });
*