templateOptions
is only available when using the jQuery Templates plugin
. When using KO native templating, it is most common to use $root
or $parent
to bind in this way. Here is some documentation on these context variables.
So, it would look like:
<dl data-bind="template: { name: 'QuarterTemplate', foreach: Quarter }"></dl>
<script id="QuarterTemplate" type="text/html">
<dd>
<label>
<input type="checkbox" data-bind="attr: { value: quarter }, checked: $parent.SelectedQuarters" />
<a data-bind="text: quarter" ></a>
</label>
</dd>
</script>
Here is an updated fiddle: http://jsfiddle.net/rniemeyer/tY5TF/