diff options
| author | Matias Niemelä | 2013-06-05 19:05:38 -0400 | 
|---|---|---|
| committer | Misko Hevery | 2013-06-06 22:09:05 -0700 | 
| commit | b36504577c538b745e6270e77d86af90285e2ae6 (patch) | |
| tree | 315ef402a114b6207e65bd9c3fcca360dd86343a /src | |
| parent | 9faabd1ba0b1929785bcf166dc0ff60008e7c442 (diff) | |
| download | angular.js-b36504577c538b745e6270e77d86af90285e2ae6.tar.bz2 | |
feat(ngdocs): provide documentation for the new ngRepeat repeater syntax
Diffstat (limited to 'src')
| -rw-r--r-- | src/ng/directive/ngRepeat.js | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 89b402c8..bc46e008 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -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  | 
