Trying to use Knockout, found a problem: I have a JSON data received from a server containing an array of objects with one field being a list of strings. Of course I can generate a list out of it easily:
<ul class='post' data-bind="foreach: $data">
<li>
<div>
<span data-bind="text: $data.name"></span> (<span data-bind="text: $data.place_type"></span>): <span data-bind='text: $data.trends.length'> </span> trends
</div>
<ul data-bind="foreach: $data.trends">
<li>
<span data-bind="text: $data"></span>
</li>
</ul>
</li>
</ul>
But now I need to generate every item from the array into a separate <div/> with an unique id, to be used elsewhere. So I can generate the required number of <div/> programatically (knowing the number of items in an (JSON )array, but how to specify bindings in that case?