Mustache: get value by key

305 Views Asked by At

How to use mustache for the following scenario:

el.html( can.view('ideasView', {ideas: records, photos: jQuery.parseJSON(users)}));

Is it possible to access photo by {{photos[id].photoUrl}}? I need to get photoUrl by ideas[i].Id when looping through ideas.

1

There are 1 best solutions below

0
On

It's hard to answer this without knowing how your photos data is structured. But from how I'm interpreting your data structure from you question. You could try

{{#ideas}} {{id}} {{\ideas}}