mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-01-12 17:12:34 +08:00
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:
committed by
Peter Bacon Darwin
parent
9e6161e579
commit
7d70dcdab1
@@ -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
|
||||
* });
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user