0

I am attempting to display weather data received from an api using handlebars. I want to display all the data after the first element, so anything that is [index] > 0. I am able to display all of it using {{#each list}} but I want to leave out the first days worth of data. I thought this would work but I can't figure it out:

                    {{#each list}}
                   {{#if @index>0}}
                        <tr>
                            <td>
                                {{dt_formatted}}

                            </td>
                            <td>
                                {{weather.0.main}}
                            </td>
                            <td>
                                {{temp.min}} ~ {{formatTemperature temp.max}}
                            </td>
                            <td>
                                {{humidity}}%
                            </td>
                            <td>
                                {{pressure}} hPa
                            </td>
                        </tr>
                     {{/if}}
                     {{/each}}
                </tbody>

Any suggestions?

Bkedds
  • 21
  • 4
  • Does this answer your question? [How to get index in Handlebars each helper?](https://stackoverflow.com/questions/11884960/how-to-get-index-in-handlebars-each-helper) – Bahador Raghibizadeh Mar 29 '21 at 21:41
  • No it does not. I know how to get the index, but not how to display certain indexes. – Bkedds Mar 29 '21 at 22:04

1 Answers1

0

Try the following:

{{#each list}}
{{#unless @first}}

(...)

{{/unless}}
{{/each}}