0

Been searching all day and still stuck on trying to access data from array object using Tempo.Tried using a variety of processes but not getting anywhere.

The array object that I'm trying to access is called options and the key is name.

<p>{{options:name}}</p>

1 Answers1

0

It's kind of difficult to answer this without at least on instance of the array object. I would suppose you have something like this:

var data = {options:[
    {name:'Test Name'},
    {name:'Another Test Name'}
]}

Just assign the options array to the data method after prepare in Tempo:

Tempo.prepare('container').data(data.options);

And in the HTML:

<div id="container">
    <p data-template>{{name}}</p>
</div>
cj5
  • 785
  • 3
  • 12
  • 34