@@ -369,14 +369,39 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
369
369
* );
370
370
* ```
371
371
*
372
+ * <div class="alert alert-warning">
373
+ * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,
374
+ * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}
375
+ * will fire `addClass` if classes are added, and `removeClass` if classes are removed.
376
+ * However, there are two exceptions:
377
+ *
378
+ * <ul>
379
+ * <li>if both an {@link ng.$animate#addClass addClass()} and a
380
+ * {@link ng.$animate#removeClass removeClass()} action are performed during the same
381
+ * animation, the event fired will be `setClass`. This is true even for `ngClass`.</li>
382
+ * <li>an {@link ng.$animate#animate animate()} call that adds and removes classes will fire
383
+ * the `setClass` event, but if it either removes or adds classes,
384
+ * it will fire `animate` instead.</li>
385
+ * </ul>
386
+ *
387
+ * </div>
388
+ *
372
389
* @param {string } event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
373
390
* @param {DOMElement } container the container element that will capture each of the animation events that are fired on itself
374
391
* as well as among its children
375
- * @param {Function } callback the callback function that will be fired when the listener is triggered
392
+ * @param {Function } callback the callback function that will be fired when the listener is triggered.
376
393
*
377
394
* The arguments present in the callback function are:
378
395
* * `element` - The captured DOM element that the animation was fired on.
379
396
* * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
397
+ * * `data` - an object with these properties:
398
+ * * addClass - `{string|null}` - space-separated CSS classes to add to the element
399
+ * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element
400
+ * * from - `{Object|null}` - CSS properties & values at the beginning of the animation
401
+ * * to - `{Object|null}` - CSS properties & values at the end of the animation
402
+ *
403
+ * Note that the callback does not trigger a scope digest. Wrap your call into a
404
+ * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.
380
405
*/
381
406
on : $$animateQueue . on ,
382
407
@@ -644,9 +669,8 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
644
669
* @param {object= } options an optional collection of options/styles that will be applied to the element.
645
670
* The object can have the following properties:
646
671
*
647
- * - **addClass** - `{string}` - space-separated CSS classes to add to element
648
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
649
672
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
673
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
650
674
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
651
675
*
652
676
* @return {Runner } animationRunner the animation runner
@@ -676,7 +700,6 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
676
700
*
677
701
* - **addClass** - `{string}` - space-separated CSS classes to add to element
678
702
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
679
- * - **removeClass** - `{string}` - space-separated CSS classes to remove from element
680
703
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
681
704
*
682
705
* @return {Runner } the animation runner
@@ -706,8 +729,8 @@ var $AnimateProvider = ['$provide', /** @this */ function($provide) {
706
729
* The object can have the following properties:
707
730
*
708
731
* - **addClass** - `{string}` - space-separated CSS classes to add to element
709
- * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
710
732
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
733
+ * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
711
734
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
712
735
*
713
736
* @return {Runner } the animation runner
0 commit comments