1
1
/**
2
- * @license AngularJS v1.6.11 -build.5555 +sha.45879a8
2
+ * @license AngularJS v1.7.1 -build.5556 +sha.05170bf
3
3
* (c) 2010-2018 Google, Inc. http://angularjs.org
4
4
* License: MIT
5
5
*/
@@ -3353,7 +3353,7 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
3353
3353
* </file>
3354
3354
* </example>
3355
3355
*/
3356
- var ngAnimateSwapDirective = [ '$animate' , '$rootScope' , function ( $animate , $rootScope ) {
3356
+ var ngAnimateSwapDirective = [ '$animate' , function ( $animate ) {
3357
3357
return {
3358
3358
restrict : 'A' ,
3359
3359
transclude : 'element' ,
@@ -3370,10 +3370,10 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3370
3370
previousScope = null ;
3371
3371
}
3372
3372
if ( value || value === 0 ) {
3373
- previousScope = scope . $new ( ) ;
3374
- $transclude ( previousScope , function ( element ) {
3375
- previousElement = element ;
3376
- $animate . enter ( element , null , $element ) ;
3373
+ $transclude ( function ( clone , childScope ) {
3374
+ previousElement = clone ;
3375
+ previousScope = childScope ;
3376
+ $animate . enter ( clone , null , $element ) ;
3377
3377
} ) ;
3378
3378
}
3379
3379
} ) ;
@@ -3398,20 +3398,28 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3398
3398
* ## Directive Support
3399
3399
* The following directives are "animation aware":
3400
3400
*
3401
- * | Directive | Supported Animations |
3402
- * |----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------|
3403
- * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave and move |
3404
- * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |
3405
- * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |
3406
- * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |
3407
- * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |
3408
- * | {@link ng.directive:ngClass#animations ngClass} | add and remove (the CSS class(es) present) |
3409
- * | {@link ng.directive:ngShow#animations ngShow} & {@link ng.directive:ngHide#animations ngHide} | add and remove (the ng-hide class value) |
3410
- * | {@link ng.directive:form#animations form} & {@link ng.directive:ngModel#animations ngModel} | add and remove (dirty, pristine, valid, invalid & all other validations) |
3411
- * | {@link module:ngMessages#animations ngMessages} | add and remove (ng-active & ng-inactive) |
3412
- * | {@link module:ngMessages#animations ngMessage} | enter and leave |
3413
- *
3414
- * (More information can be found by visiting each the documentation associated with each directive.)
3401
+ * | Directive | Supported Animations |
3402
+ * |-------------------------------------------------------------------------------|---------------------------------------------------------------------------|
3403
+ * | {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |
3404
+ * | {@link ngAnimate.directive:ngAnimateSwap#animations ngAnimateSwap} | enter and leave |
3405
+ * | {@link ng.directive:ngClass#animations ngClass / {{class}​}} | add and remove |
3406
+ * | {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove |
3407
+ * | {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove |
3408
+ * | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |
3409
+ * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |
3410
+ * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |
3411
+ * | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave |
3412
+ * | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |
3413
+ * | {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |
3414
+ * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move |
3415
+ * | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |
3416
+ * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |
3417
+ * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |
3418
+ *
3419
+ * (More information can be found by visiting the documentation associated with each directive.)
3420
+ *
3421
+ * For a full breakdown of the steps involved during each animation event, refer to the
3422
+ * {@link ng.$animate `$animate` API docs}.
3415
3423
*
3416
3424
* ## CSS-based Animations
3417
3425
*
@@ -3648,9 +3656,22 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
3648
3656
* .message.ng-enter-prepare {
3649
3657
* opacity: 0;
3650
3658
* }
3651
- *
3652
3659
* ```
3653
3660
*
3661
+ * ### Animating between value changes
3662
+ *
3663
+ * Sometimes you need to animate between different expression states, whose values
3664
+ * don't necessary need to be known or referenced in CSS styles.
3665
+ * Unless possible with another ["animation aware" directive](#directive-support), that specific
3666
+ * use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as can be seen in
3667
+ * {@link ngAnimate.directive:ngAnimateSwap#examples this example}.
3668
+ *
3669
+ * Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it
3670
+ * creates a new instance of the element (including any other/child directives it may have) and
3671
+ * links it to a new scope every time *swap* happens. In some cases this might not be desirable
3672
+ * (e.g. for performance reasons, or when you wish to retain internal state on the original
3673
+ * element instance).
3674
+ *
3654
3675
* ## JavaScript-based Animations
3655
3676
*
3656
3677
* ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared
@@ -4139,7 +4160,7 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
4139
4160
isFunction = angular . isFunction ;
4140
4161
isElement = angular . isElement ;
4141
4162
} )
4142
- . info ( { angularVersion : '1.6.11 -build.5555 +sha.45879a8 ' } )
4163
+ . info ( { angularVersion : '1.7.1 -build.5556 +sha.05170bf ' } )
4143
4164
. directive ( 'ngAnimateSwap' , ngAnimateSwapDirective )
4144
4165
4145
4166
. directive ( 'ngAnimateChildren' , $$AnimateChildrenDirective )
0 commit comments