1
1
'use strict' ;
2
2
3
+ /**
4
+ * @ngdoc directive
5
+ * @name ngAnimateChildren
6
+ * @restrict AE
7
+ * @element ANY
8
+ *
9
+ * @description
10
+ *
11
+ * ngAnimateChildren allows you to specify that children of this element should animate even if any
12
+ * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`
13
+ * (structural) animation, child elements that also have an active structural animation are not animated.
14
+ *
15
+ * Note that even if `ngAnimteChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).
16
+ *
17
+ *
18
+ * @param {string } ngAnimateChildren If the value is empty, `true` or `on`,
19
+ * then child animations are allowed. If the value is `false`, child animations are not allowed.
20
+ *
21
+ * @example
22
+ * <example module="ngAnimateChildren" name="ngAnimateChildren" deps="angular-animate.js" animations="true">
23
+ <file name="index.html">
24
+ <div ng-controller="mainController as main">
25
+ <label>Show container? <input type="checkbox" ng-model="main.enterElement" /></label>
26
+ <label>Animate children? <input type="checkbox" ng-model="main.animateChildren" /></label>
27
+ <hr>
28
+ <div ng-animate-children="{{main.animateChildren}}">
29
+ <div ng-if="main.enterElement" class="container">
30
+ List of items:
31
+ <div ng-repeat="item in [0, 1, 2, 3]" class="item">Item {{item}}</div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </file>
36
+ <file name="animations.css">
37
+
38
+ .container.ng-enter,
39
+ .container.ng-leave {
40
+ transition: all ease 1.5s;
41
+ }
42
+
43
+ .container.ng-enter,
44
+ .container.ng-leave-active {
45
+ opacity: 0;
46
+ }
47
+
48
+ .container.ng-leave,
49
+ .container.ng-enter-active {
50
+ opacity: 1;
51
+ }
52
+
53
+ .item {
54
+ background: firebrick;
55
+ color: #FFF;
56
+ margin-bottom: 10px;
57
+ }
58
+
59
+ .item.ng-enter,
60
+ .item.ng-leave {
61
+ transition: transform 1.5s ease;
62
+ }
63
+
64
+ .item.ng-enter {
65
+ transform: translateX(50px);
66
+ }
67
+
68
+ .item.ng-enter-active {
69
+ transform: translateX(0);
70
+ }
71
+ </file>
72
+ <file name="script.js">
73
+ angular.module('ngAnimateChildren', ['ngAnimate'])
74
+ .controller('mainController', function() {
75
+ this.animateChildren = false;
76
+ this.enterElement = false;
77
+ });
78
+ </file>
79
+ </example>
80
+ */
3
81
var $$AnimateChildrenDirective = [ '$interpolate' , function ( $interpolate ) {
4
82
return {
5
83
link : function ( scope , element , attrs ) {
@@ -9,7 +87,7 @@ var $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {
9
87
} else {
10
88
// Interpolate and set the value, so that it is available to
11
89
// animations that run right after compilation
12
- setData ( $interpolate ( attrs . ngAnimateChildren ) ( scope ) ) ;
90
+ setData ( $interpolate ( val ) ( scope ) ) ;
13
91
attrs . $observe ( 'ngAnimateChildren' , setData ) ;
14
92
}
15
93
0 commit comments