@@ -57,7 +57,39 @@ var $AnimateProvider = ['$provide', function($provide) {
57
57
} ;
58
58
59
59
this . $get = [ '$timeout' , function ( $timeout ) {
60
+
61
+ /**
62
+ * @ngdoc object
63
+ * @name ng.$animate
64
+ *
65
+ * @description
66
+ * The $animate service provides rudimentary DOM manipulation functions to insert, remove, move elements within
67
+ * the DOM as well as adding and removing classes. This service is the core service used by the ngAnimate $animator
68
+ * service which provides high-level animation hooks for CSS and JavaScript.
69
+ *
70
+ * $animate is available in the AngularJS core, however, the ngAnimate module must be included to enable full out
71
+ * animation support. Otherwise, $animate will only perform simple DOM manipulation operations.
72
+ *
73
+ * To learn more about enabling animation support, click here to visit the {@link ngAnimate ngAnimate module page}
74
+ * as well as the {@link ngAnimate.$animate ngAnimate $animate service page}.
75
+ */
60
76
return {
77
+
78
+ /**
79
+ * @ngdoc function
80
+ * @name ng.$animate#enter
81
+ * @methodOf ng.$animate
82
+ * @function
83
+ *
84
+ * @description
85
+ * Inserts the element into the DOM either after the `after` element or within the `parent` element. Once complete,
86
+ * the done() callback will be fired (if provided).
87
+ *
88
+ * @param {jQuery/jqLite element } element the element which will be inserted into the DOM
89
+ * @param {jQuery/jqLite element } parent the parent element which will append the element as a child (if the after element is not present)
90
+ * @param {jQuery/jqLite element } after the sibling element which will append the element after itself
91
+ * @param {function= } done callback function that will be called after the element has been inserted into the DOM
92
+ */
61
93
enter : function ( element , parent , after , done ) {
62
94
var afterNode = after && after [ after . length - 1 ] ;
63
95
var parentNode = parent && parent [ 0 ] || afterNode && afterNode . parentNode ;
@@ -69,17 +101,57 @@ var $AnimateProvider = ['$provide', function($provide) {
69
101
$timeout ( done || noop , 0 , false ) ;
70
102
} ,
71
103
104
+ /**
105
+ * @ngdoc function
106
+ * @name ng.$animate#leave
107
+ * @methodOf ng.$animate
108
+ * @function
109
+ *
110
+ * @description
111
+ * Removes the element from the DOM. Once complete, the done() callback will be fired (if provided).
112
+ *
113
+ * @param {jQuery/jqLite element } element the element which will be removed from the DOM
114
+ * @param {function= } done callback function that will be called after the element has been removed from the DOM
115
+ */
72
116
leave : function ( element , done ) {
73
117
element . remove ( ) ;
74
118
$timeout ( done || noop , 0 , false ) ;
75
119
} ,
76
120
121
+ /**
122
+ * @ngdoc function
123
+ * @name ng.$animate#move
124
+ * @methodOf ng.$animate
125
+ * @function
126
+ *
127
+ * @description
128
+ * Moves the position of the provided element within the DOM to be placed either after the `after` element or inside of the `parent` element.
129
+ * Once complete, the done() callback will be fired (if provided).
130
+ *
131
+ * @param {jQuery/jqLite element } element the element which will be moved around within the DOM
132
+ * @param {jQuery/jqLite element } parent the parent element where the element will be inserted into (if the after element is not present)
133
+ * @param {jQuery/jqLite element } after the sibling element where the element will be positioned next to
134
+ * @param {function= } done the callback function (if provided) that will be fired after the element has been moved to it's new position
135
+ */
77
136
move : function ( element , parent , after , done ) {
78
137
// Do not remove element before insert. Removing will cause data associated with the
79
138
// element to be dropped. Insert will implicitly do the remove.
80
139
this . enter ( element , parent , after , done ) ;
81
140
} ,
82
141
142
+ /**
143
+ * @ngdoc function
144
+ * @name ng.$animate#addClass
145
+ * @methodOf ng.$animate
146
+ * @function
147
+ *
148
+ * @description
149
+ * Adds the provided className CSS class value to the provided element. Once complete, the done() callback will be fired (if provided).
150
+ *
151
+ * @param {jQuery/jqLite element } element the element which will have the className value added to it
152
+ * @param {string } className the CSS class which will be added to the element
153
+ * @param {function= } done the callback function (if provided) that will be fired after the className value has been added to the element
154
+ */
83
155
addClass : function ( element , className , done ) {
84
156
className = isString ( className ) ?
85
157
className :
@@ -88,6 +160,19 @@ var $AnimateProvider = ['$provide', function($provide) {
88
160
$timeout ( done || noop , 0 , false ) ;
89
161
} ,
90
162
163
+ /**
164
+ * @ngdoc function
165
+ * @name ng.$animate#removeClass
166
+ * @methodOf ng.$animate
167
+ * @function
168
+ *
169
+ * @description
170
+ * Removes the provided className CSS class value from the provided element. Once complete, the done() callback will be fired (if provided).
171
+ *
172
+ * @param {jQuery/jqLite element } element the element which will have the className value removed from it
173
+ * @param {string } className the CSS class which will be removed from the element
174
+ * @param {function= } done the callback function (if provided) that will be fired after the className value has been removed from the element
175
+ */
91
176
removeClass : function ( element , className , done ) {
92
177
className = isString ( className ) ?
93
178
className :
0 commit comments