Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit b365045

Browse files
matskomhevery
authored andcommitted
feat(ngdocs): provide documentation for the new ngRepeat repeater syntax
1 parent 9faabd1 commit b365045

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

src/ng/directive/ngRepeat.js

+45
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,51 @@
2121
* Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter**,
2222
* **leave** and **move** effects.
2323
*
24+
*
25+
* # Special repeat start and end points
26+
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
27+
* the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
28+
* The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)
29+
* up to and including the ending HTML tag where **ng-repeat-end** is placed.
30+
*
31+
* The example below makes use of this feature:
32+
* <pre>
33+
* <header ng-repeat-start="item in items">
34+
* Header {{ item }}
35+
* </header>
36+
* <div class="body">
37+
* Body {{ item }}
38+
* </div>
39+
* <footer ng-repeat-end>
40+
* Footer {{ item }}
41+
* </footer>
42+
* </pre>
43+
*
44+
* And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:
45+
* <pre>
46+
* <header>
47+
* Header A
48+
* </header>
49+
* <div class="body">
50+
* Body A
51+
* </div>
52+
* <footer>
53+
* Footer A
54+
* </footer>
55+
* <header>
56+
* Header B
57+
* </header>
58+
* <div class="body">
59+
* Body B
60+
* </div>
61+
* <footer>
62+
* Footer B
63+
* </footer>
64+
* </pre>
65+
*
66+
* The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such
67+
* as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
68+
*
2469
* @animations
2570
* enter - when a new item is added to the list or when an item is revealed after a filter
2671
* leave - when an item is removed from the list or when an item is filtered out

0 commit comments

Comments
 (0)