title: Is there any way to create a computed property on an array without making it observable?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6047713/bind-template-item-to-the-index-of-the-array-in-knockoutjs">Bind template item to the index of the array in KnockoutJS</a>  </p>
  </blockquote>
  
  
  
  <p>I'm using templates in knockout to render a list of items. For each item I want to create an anchor tag which is a concatenation of the word 'item' and the itemId (a property of the each item in the collection)</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;a name='item0' /&gt;
  &lt;a name='item1' /&gt;
  ...
  &lt;a name='item99' /&gt;
  </code></pre>
  
  <p>I'd like to do this with a computed property (AnchorName) on the array item and then use the data-bind such as:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;a data-bind="attr:{ name: AnchorName } /&gt;
  </code></pre>
  
  <p>Alternately I'd like to do concatenation right in the template and not bother with the computed property but I'm not sure if that is possible or what that syntax might look like.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Based on accepted answer I was able to do this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;a data-bind="attr:{ name: 'item' + ItemId } /&gt;
  </code></pre>