a question about syntax of benchpressjs


  • I have a question about benchpressjs: say, I have an array, I want to skip the output for the first and second item in the array, here is my code:

                        *{{{ each localNews.topics }}}
                        {{{ if @index !="0" }}}
                        {{{ if @index !="1" }}}
                        <div>{@value}</div>
                        {{{ end }}}
                        {{{ end }}}
                        {{{ end }}}*
    

    but the code is not working, any ideas or suggestion? thanks in advance

  • Global Moderator

    We don't have any built in conditional support. There's the @first helper which works for when you only want to check if @index == 0. To do this, I'd suggest adding a helper for whatever condition you need.

Suggested Topics

  • 2
  • 1
  • 2
  • 7
  • 15
| |