Skip to content

Commit bb72504

Browse files
committed
v1.7.1-build.5556+sha.05170bf
1 parent a9aaacc commit bb72504

File tree

125 files changed

+2824
-938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+2824
-938
lines changed

snapshot/angular-animate.js

+43-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.6.11-build.5555+sha.45879a8
2+
* @license AngularJS v1.7.1-build.5556+sha.05170bf
33
* (c) 2010-2018 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -3353,7 +3353,7 @@ var $$AnimationProvider = ['$animateProvider', /** @this */ function($animatePro
33533353
* </file>
33543354
* </example>
33553355
*/
3356-
var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $rootScope) {
3356+
var ngAnimateSwapDirective = ['$animate', function($animate) {
33573357
return {
33583358
restrict: 'A',
33593359
transclude: 'element',
@@ -3370,10 +3370,10 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
33703370
previousScope = null;
33713371
}
33723372
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);
33773377
});
33783378
}
33793379
});
@@ -3398,20 +3398,28 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
33983398
* ## Directive Support
33993399
* The following directives are "animation aware":
34003400
*
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&#125;&#8203;&#125;} | 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}.
34153423
*
34163424
* ## CSS-based Animations
34173425
*
@@ -3648,9 +3656,22 @@ var ngAnimateSwapDirective = ['$animate', '$rootScope', function($animate, $root
36483656
* .message.ng-enter-prepare {
36493657
* opacity: 0;
36503658
* }
3651-
*
36523659
* ```
36533660
*
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+
*
36543675
* ## JavaScript-based Animations
36553676
*
36563677
* 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() {
41394160
isFunction = angular.isFunction;
41404161
isElement = angular.isElement;
41414162
})
4142-
.info({ angularVersion: '1.6.11-build.5555+sha.45879a8' })
4163+
.info({ angularVersion: '1.7.1-build.5556+sha.05170bf' })
41434164
.directive('ngAnimateSwap', ngAnimateSwapDirective)
41444165

41454166
.directive('ngAnimateChildren', $$AnimateChildrenDirective)

0 commit comments

Comments
 (0)