title: Knockout.js - How bind a data-var in a foreach
body: <p>I would like to bind <code>data-id</code> to my looped items in knockout</p>
  
  <pre><code>    &lt;ul data-bind="foreach: items"&gt;
          &lt;li data-bind="attr: {data-id: $data.id}"&gt;
              &lt;p data-bind="text: title"&gt;&lt;/p&gt;
              &lt;img alt="" data-bind="attr: {src: $data.img}"&gt;
              &lt;h4&gt;Volkswagen.co.uk&lt;/h4&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p><code>&lt;li data-bind="attr: {data-id: $data.id}"&gt;</code> So specifically this line of code is what I would like to get working.</p>