1

If I have this handlebars template:

<p>{{array.0.title}}</p>

and this context

 array: [{title: First Title},
        {title: Second Title}]

It will output

<p>First Title</p>

Is it possible to dynamically change the 0 so that it will output

<p>Second Title</p>

Ideally, I would be able to use a variable such as index in the handlebar expression:

{{array.index.title}}

Is there a way to do this?

AMT
  • 754
  • 8
  • 13
  • What do you mean typing `dynamically`. – Daniel Jul 02 '17 at 15:39
  • Perhaps dynamically isn't the right word. What I'd like to do is select an option from a dropdown that changes the 0 to a 1 – AMT Jul 02 '17 at 15:54
  • Possible duplicate of [How to get an array value at index using Handlebars.js?](https://stackoverflow.com/questions/18168924/how-to-get-an-array-value-at-index-using-handlebars-js) – Andrew Li Jul 03 '17 at 15:27

0 Answers0