From 706a4d5755db30ab5e1dfb4cf8927bb82216b9b9 Mon Sep 17 00:00:00 2001 From: Yuvaraja Balamurugan Date: Fri, 18 Dec 2015 00:23:00 +0530 Subject: [PATCH] [DOC release] Document on index block param for each helper --- packages/ember-htmlbars/lib/helpers/each.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/ember-htmlbars/lib/helpers/each.js b/packages/ember-htmlbars/lib/helpers/each.js index 031638afede..816d6565205 100644 --- a/packages/ember-htmlbars/lib/helpers/each.js +++ b/packages/ember-htmlbars/lib/helpers/each.js @@ -11,7 +11,7 @@ import decodeEachKey from 'ember-htmlbars/utils/decode-each-key'; of the base Handlebars `{{#each}}` helper. The default behavior of `{{#each}}` is to yield its inner block once for every - item in an array. + item in an array passing the item as the first param to the block. ```javascript var developers = [{name: 'Yehuda'},{name: 'Tom'}, {name: 'Paul'}]; @@ -36,6 +36,16 @@ import decodeEachKey from 'ember-htmlbars/utils/decode-each-key'; {{/each}} ``` + During iteration, the index of each item in the array is provided as a second block param. + + ```handlebars + + ``` + ### Specifying Keys The `key` option is used to tell Ember how to determine if the array being