mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
feat(ngdocs): provide documentation for the new ngRepeat repeater syntax
This commit is contained in:
parent
9faabd1ba0
commit
b36504577c
1 changed files with 45 additions and 0 deletions
|
|
@ -21,6 +21,51 @@
|
|||
* Additionally, you can also provide animations via the ngAnimate attribute to animate the **enter**,
|
||||
* **leave** and **move** effects.
|
||||
*
|
||||
*
|
||||
* # Special repeat start and end points
|
||||
* To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
|
||||
* the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
|
||||
* 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)
|
||||
* up to and including the ending HTML tag where **ng-repeat-end** is placed.
|
||||
*
|
||||
* The example below makes use of this feature:
|
||||
* <pre>
|
||||
* <header ng-repeat-start="item in items">
|
||||
* Header {{ item }}
|
||||
* </header>
|
||||
* <div class="body">
|
||||
* Body {{ item }}
|
||||
* </div>
|
||||
* <footer ng-repeat-end>
|
||||
* Footer {{ item }}
|
||||
* </footer>
|
||||
* </pre>
|
||||
*
|
||||
* And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:
|
||||
* <pre>
|
||||
* <header>
|
||||
* Header A
|
||||
* </header>
|
||||
* <div class="body">
|
||||
* Body A
|
||||
* </div>
|
||||
* <footer>
|
||||
* Footer A
|
||||
* </footer>
|
||||
* <header>
|
||||
* Header B
|
||||
* </header>
|
||||
* <div class="body">
|
||||
* Body B
|
||||
* </div>
|
||||
* <footer>
|
||||
* Footer B
|
||||
* </footer>
|
||||
* </pre>
|
||||
*
|
||||
* The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such
|
||||
* as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
|
||||
*
|
||||
* @animations
|
||||
* enter - when a new item is added to the list or when an item is revealed after a filter
|
||||
* leave - when an item is removed from the list or when an item is filtered out
|
||||
|
|
|
|||
Loading…
Reference in a new issue