Rendering 2 separate arrays in Dust.js

dust.js, javascript

Solution

The Dust way to do this is to change the data (if that's possible):

{
    numbers: [
        {val1: 5, val2: 10},
        {val1: 10, val2: 20},
        {val1: 20, val2: 40}
    ]
}

Then your template would look like this:

{#numbers}
  <div class="span2">
    <input type="number" value="{val1}"></div>
  <div class="span2">
    <input type="number" value="{val2}"></div>
  </div>
{/numbers}

Problem

So im trying to render a dust template with two separate arrays. My data is something like: ``` { array1: [5, 10, 20], array2: [10, 20, 40] } ``` And my dust template looks like: ``` {#array1} <div class="span2"> <input type="number" value={.}></div> <div class="span2"> <input type="number" value={array2[{$idx}]}></div> </div>{~n} {/array1} ``` It displays the elements from array1 fine, but all the inputs for array2 are blank. I'm using dust-full-1.2.2.js linkedIn fork. What should I do to be able to display the values of array2?

Original source