You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
David Wolfe edited this page Jun 23, 2013
·
5 revisions
foreach
By default the each helper in handlebars adds the private properties @index for arrays and @key for objects, which can be used inside the each loop.
foreach extends this and adds the additional private properties of @first, @last, @even, @odd, @rowStart and @rowEnd to both arrays and objects. This can be used to produce more complex layouts for post lists and other content. For examples see below:
@first & @last
The following checks through an array or object e.g posts and tests for the first entry.