Question: How to create a custom helper with access to @index
See original GitHub issueHi, I want to create a range helper such that I can do the following
{{#range 1 10}}
<h1>{{@index}}</h1>
{{/range}}
but I can’t figure out how you create a custom helper with access to the @index parameter, can anyone point me in the right direction?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Handlebars: How pass @index as parameter to custom ...
I'm using Handelbars.PHP, but maybe a solution with Handlebars. · A custom helper content that expects two parameters a collection and an index....
Read more >How pass @index as parameter to custom helper · Issue #27
Setup: - A custom helper content that expects two parameters a collection and an index. - An #each helper invocation that calls to...
Read more >hapi — Create and Use Custom Handlebars Helpers
This time, we use the helpersPath option and create our own custom handlebars helpers for views rendered by hapi.
Read more >Action View Form Helpers
How to make model-centric forms for creating and editing specific database records ... Basic Structures; Combining Them; The fields_for Helper :index Option.
Read more >Handlebars helper reference
Custom helpers, Block helpers, Data variables ... d - Generate indices for substring matches. g - Global search. i - Case-insensitive search.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s shown as a helper example here: http://handlebarsjs.com/block_helpers.html (section “Hash Arguments”), last example.
Hello @spc-89 . The functionality is going to become available in 2.0 version of the library. It’s going to be published once my fork would be merged to the trunk. Follow PRs to be updated.