From fefd31a2cd10bf45e64fd81e1f4868dc5dca1dda Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Fri, 13 Feb 2015 16:59:07 -0800 Subject: [PATCH] Document @index in spacebars' README --- packages/spacebars/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/spacebars/README.md b/packages/spacebars/README.md index dc6ff6a750..3ea70d98d8 100644 --- a/packages/spacebars/README.md +++ b/packages/spacebars/README.md @@ -365,6 +365,9 @@ for example), but it may also be a plain JavaScript array, `null`, or An "else" section may be provided, which is used (with no new data context) if there are zero items in the sequence at any time. +You can use a special variable `@index` in the body of `#each` to get the +0-based index of the currently rendered value in the sequence. + ### Reactivity Model for Each When the argument to `#each` changes, the DOM is always updated to reflect the