Skip to content

Commit d3b2e40

Browse files
committed
docs: clean up formatting of animation events
Closes angular#12670 Closes angular#10742
1 parent 63154c3 commit d3b2e40

File tree

8 files changed

+36
-19
lines changed

8 files changed

+36
-19
lines changed

src/ng/directive/ngClass.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ function classDirective(name, selector) {
148148
* new classes added.
149149
*
150150
* @animations
151-
* **add** - happens just before the class is applied to the elements
152-
*
153-
* **remove** - happens just before the class is removed from the element
151+
* | Animation | Occurs |
152+
* |----------------------------------|-------------------------------------|
153+
* | {@link ng.$animate#addClass addClass} | just before the class is applied to the element |
154+
* | {@link ng.$animate#removeClass removeClass} | just before the class is removed from the element |
154155
*
155156
* @element ANY
156157
* @param {expression} ngClass {@link guide/expression Expression} to eval. The result

src/ng/directive/ngIf.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
* and `leave` effects.
3535
*
3636
* @animations
37-
* enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container
38-
* leave - happens just before the `ngIf` contents are removed from the DOM
37+
* | Animation | Occurs |
38+
* |----------------------------------|-------------------------------------|
39+
* | {@link ng.$animate#enter enter} | just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container |
40+
* | {@link ng.$animate#leave leave} | just before the `ngIf` contents are removed from the DOM |
3941
*
4042
* @element ANY
4143
* @scope

src/ng/directive/ngInclude.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
* access on some browsers.
2424
*
2525
* @animations
26-
* enter - animation is used to bring new content into the browser.
27-
* leave - animation is used to animate existing content away.
26+
* | Animation | Occurs |
27+
* |----------------------------------|-------------------------------------|
28+
* | {@link ng.$animate#enter enter} | when the expression changes, on the new include |
29+
* | {@link ng.$animate#leave leave} | when the expression changes, on the old include |
2830
*
2931
* The enter and leave animation occur concurrently.
3032
*

src/ng/directive/ngRepeat.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@
164164
* as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
165165
*
166166
* @animations
167-
* **.enter** - when a new item is added to the list or when an item is revealed after a filter
168-
*
169-
* **.leave** - when an item is removed from the list or when an item is filtered out
170-
*
171-
* **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
167+
* | Animation | Occurs |
168+
* |----------------------------------|-------------------------------------|
169+
* | {@link ng.$animate#enter .enter} | when a new item is added to the list or when an item is revealed after a filter |
170+
* | {@link ng.$animate#leave .leave} | when an item is removed from the list or when an item is filtered out |
171+
* | {@link ng.$animate#move .move } | when an adjacent item is filtered out causing a reorder or when the item contents are reordered |
172172
*
173173
* See the example below for defining CSS animations with ngRepeat.
174174
*

src/ng/directive/ngShowHide.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
8989
* property to block during animation states--ngAnimate will handle the style toggling automatically for you.
9090
*
9191
* @animations
92-
* addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible
93-
* removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden
92+
* | Animation | Occurs |
93+
* |----------------------------------|-------------------------------------|
94+
* | {@link $animate#addClass addClass} `.ng-hide` | after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible |
95+
* | {@link $animate#removeClass removeClass} `.ng-hide` | - after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden |
9496
*
9597
* @element ANY
9698
* @param {expression} ngShow If the {@link guide/expression expression} is truthy

src/ng/directive/ngSwitch.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
* </div>
2828
2929
* @animations
30-
* enter - happens after the ngSwitch contents change and the matched child element is placed inside the container
31-
* leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM
30+
* | Animation | Occurs |
31+
* |----------------------------------|-------------------------------------|
32+
* | {@link ng.$animate#enter enter} enter | after the ngSwitch contents change and the matched child element is placed inside the container |
33+
* | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM |
3234
*
3335
* @usage
3436
*

src/ngAnimate/ngAnimateSwap.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@
1010
*
1111
* ngAnimateSwap is a animation-oriented directive that allows for the container to
1212
* be removed and entered in whenever the associated expression changes. A
13-
* common usecase for this directive is a rotating banner component which
13+
* common usecase for this directive is a rotating banner or slider component which
1414
* contains one image being present at a time. When the active image changes
1515
* then the old image will perform a `leave` animation and the new element
1616
* will be inserted via an `enter` animation.
1717
*
18+
* @animations
19+
* | Animation | Occurs |
20+
* |----------------------------------|--------------------------------------|
21+
* | {@link ng.$animate#enter enter} | when the expression changes, on the new element |
22+
* | {@link ng.$animate#leave leave} | when the expression changes, on the old element |
23+
*
1824
* @example
1925
* <example name="ngAnimateSwap-directive" module="ngAnimateSwapExample"
2026
* deps="angular-animate.js"

src/ngRoute/directive/ngView.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ ngRouteModule.directive('ngView', ngViewFillContentFactory);
1919
* Requires the {@link ngRoute `ngRoute`} module to be installed.
2020
*
2121
* @animations
22-
* enter - animation is used to bring new content into the browser.
23-
* leave - animation is used to animate existing content away.
22+
* | Animation | Occurs |
23+
* |----------------------------------|-------------------------------------|
24+
* | {@link ng.$animate#enter enter} | when the expression changes, on the new view |
25+
* | {@link ng.$animate#leave leave} | when the expression changes, on the old view |
2426
*
2527
* The enter and leave animation occur concurrently.
2628
*

0 commit comments

Comments
 (0)