Skip to content

Commit 146dad7

Browse files
wesleychoNarretz
authored andcommitted
docs($animate): detail options object
- Document options object used in various $animate methods Fixes angular#12645 PR: angular#14700
1 parent 8e55b78 commit 146dad7

File tree

1 file changed

+49
-7
lines changed

1 file changed

+49
-7
lines changed

src/ng/animate.js

+49-7
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,13 @@ var $AnimateProvider = ['$provide', function($provide) {
420420
* @param {DOMElement} parent the parent element which will append the element as
421421
* a child (so long as the after element is not present)
422422
* @param {DOMElement=} after the sibling element after which the element will be appended
423-
* @param {object=} options an optional collection of options/styles that will be applied to the element
423+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
424+
* The object can have the following properties:
425+
*
426+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
427+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
428+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
429+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
424430
*
425431
* @return {Promise} the animation callback promise
426432
*/
@@ -446,7 +452,13 @@ var $AnimateProvider = ['$provide', function($provide) {
446452
* @param {DOMElement} parent the parent element which will append the element as
447453
* a child (so long as the after element is not present)
448454
* @param {DOMElement=} after the sibling element after which the element will be appended
449-
* @param {object=} options an optional collection of options/styles that will be applied to the element
455+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
456+
* The object can have the following properties:
457+
*
458+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
459+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
460+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
461+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
450462
*
451463
* @return {Promise} the animation callback promise
452464
*/
@@ -467,7 +479,13 @@ var $AnimateProvider = ['$provide', function($provide) {
467479
* digest once the animation has completed.
468480
*
469481
* @param {DOMElement} element the element which will be removed from the DOM
470-
* @param {object=} options an optional collection of options/styles that will be applied to the element
482+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
483+
* The object can have the following properties:
484+
*
485+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
486+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
487+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
488+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
471489
*
472490
* @return {Promise} the animation callback promise
473491
*/
@@ -491,7 +509,13 @@ var $AnimateProvider = ['$provide', function($provide) {
491509
*
492510
* @param {DOMElement} element the element which the CSS classes will be applied to
493511
* @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
494-
* @param {object=} options an optional collection of options/styles that will be applied to the element
512+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
513+
* The object can have the following properties:
514+
*
515+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
516+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
517+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
518+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
495519
*
496520
* @return {Promise} the animation callback promise
497521
*/
@@ -515,7 +539,13 @@ var $AnimateProvider = ['$provide', function($provide) {
515539
*
516540
* @param {DOMElement} element the element which the CSS classes will be applied to
517541
* @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
518-
* @param {object=} options an optional collection of options/styles that will be applied to the element
542+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
543+
* The object can have the following properties:
544+
*
545+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
546+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
547+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
548+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
519549
*
520550
* @return {Promise} the animation callback promise
521551
*/
@@ -540,7 +570,13 @@ var $AnimateProvider = ['$provide', function($provide) {
540570
* @param {DOMElement} element the element which the CSS classes will be applied to
541571
* @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
542572
* @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
543-
* @param {object=} options an optional collection of options/styles that will be applied to the element
573+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
574+
* The object can have the following properties:
575+
*
576+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
577+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
578+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
579+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
544580
*
545581
* @return {Promise} the animation callback promise
546582
*/
@@ -581,7 +617,13 @@ var $AnimateProvider = ['$provide', function($provide) {
581617
* @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
582618
* this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
583619
* (Note that if no animation is detected then this value will not be applied to the element.)
584-
* @param {object=} options an optional collection of options/styles that will be applied to the element
620+
* @param {object=} options an optional collection of options/styles that will be applied to the element.
621+
* The object can have the following properties:
622+
*
623+
* - **addClass** - `{string}` - space-separated CSS classes to add to element
624+
* - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`
625+
* - **removeClass** - `{string}` - space-separated CSS classes to remove from element
626+
* - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`
585627
*
586628
* @return {Promise} the animation callback promise
587629
*/

0 commit comments

Comments
 (0)