Sunday, 9 April 2017

Node.js adding offset to

Using Node.js and handlebars, I am trying to add an offset to the index of my values, so that it starts at 1 and not 0. I have written a custom helper to help me with that :


    <li class="list-class">
        Item number 
    </li>


<script>
    var Handlebars = require('handlebars');

    Handlebars.registerHelper("inc", function(value, options)
    {
        return parseInt(value) + 1;
    });
</script>

However, I get an error : Missing helper: "inc"



via Rockasaurus

No comments:

Post a Comment