Skip to content

Bind keys of key-value-pairs to templates using unnamed bind parameters

Choose a tag to compare

@g105b g105b released this 24 May 19:48
151ed5f

Along with a dependency bump, this release brings the ability to bind the key of a key-value-pair data structure (such as an associative array) to a template element, with unnamed bind parameters.

Using the _key bind parameter will bind whatever the key is in a key-value-pair iterator. Nice for passing around associative arrays.

An example:

<ul>
  <li data-template> 
    Name: <span data-bind:text="_key">Person Name</span>, 
    Age: <span data-bind:text>0</span>
  </li>
</ul>