Skip to content

Commit 357b0d2

Browse files
committed
docs(ngAnimate): add animating any scope's variable change section
Add a section which covers use case when user's need to animate upon every variable's value change. Refers angular#16561
1 parent 78b9f61 commit 357b0d2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ngAnimate/module.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,14 @@
267267
* .message.ng-enter-prepare {
268268
* opacity: 0;
269269
* }
270-
*
271270
* ```
272271
*
272+
* ### Animating any scope's variable change
273+
*
274+
* Unless possible with more proper ["animation aware" directive](#directive-support), that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}.
275+
*
276+
* Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it creates a new instance of the element (including any other/child directives it may have) and links it to a new scope every time *swap* happens. In some cases this might not be desirable (e.g. for performance reasons, or when wish to retain internal state on the original element's instance).
277+
*
273278
* ## JavaScript-based Animations
274279
*
275280
* ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared

0 commit comments

Comments
 (0)