helpers / handlebars-helpers

188 handlebars helpers in ~20 categories. Can be used with Assemble, Ghost, YUI, express.js etc.
http://assemble.io/helpers/
MIT License
2.22k stars 364 forks source link

How to sort array by specific integer value in Handlebars NodeJS #355

Open PProtonzz opened 5 years ago

PProtonzz commented 5 years ago
{{#each games}}
        {{#if this.yellow}}
        <div class='rblock3'>
            <div class='tit'>{{this.game_name}}</div>
            <div class='live_res'>{{this.game_value}}</div>
        </div>
        {{else}}
        <div class='rblock1'>
            <div class='tit'>{{this.game_name}}</div>
            <div class='live_res'>{{this.game_value}}</div>
        </div>
        {{/if}}
 {{/each}}
doowb commented 5 years ago

Have you looked at the sortBy helper? This can be used in a handlebars subexpression