title: Is it possible to add optional binding parameters in a templatebinding?
body: <p>I'm busy creating templates for a medium-size project. I use knockoutjs with the jquery template engine and everything is going fine. I'm nesting some templates a couple of levels deep.
  Now I would like to add optional binding parameters to some templates. This is my binding to the root template, inside a html table:</p>
  
  <pre><code>&lt;tr data-bind="template: { name: 'RowTextboxTemplate', data: { caption: 'Transporter', property: Transporter } }" /&gt;
  </code></pre>
  
  <p>This is the rowtextboxtemplate template:</p>
  
  <pre><code>&lt;td data-bind="template: { name: 'CellLabelTemplate', data: { caption: caption, property: property } }" /&gt;
  &lt;td data-bind="template: { name: 'TextboxTemplate', data: { field: property } }" /&gt;
  </code></pre>
  
  <p>And this is one of the subtemplates, the textboxtemplate:</p>
  
  <pre><code>&lt;input data-bind="value: field, valueUpdate: 'afterkeydown'" type="text"&gt;
  </code></pre>
  
  <p>Now, I would like to do this:</p>
  
  <pre><code>&lt;tr data-bind="template: { name: 'RowTextboxTemplate', data: { caption: 'Transporter', property: Transporter, readOnly: IsTransporterReadOnly } }" /&gt;
  </code></pre>
  
  <p>However, I would like for it to be optional, so when omitting the last property it would still work. The reason I want this is that there are a lot of fields who don't require this parameter, so it would pollute my HTML.
  I tried this in the root template:</p>
  
  <pre><code>    &lt;td data-bind="template: { name: 'CellLabelTemplate', data: { caption: caption, property: property } }" /&gt;
  {{if readOnly !== undefined}}
   &lt;td data-bind="template: { name: 'CellComboboxTemplate', data: { options: property, selectedValue: selectedValue, optionsText: optionsText, readOnly: readOnly } }" /&gt;
  {{else}}
   &lt;td data-bind="template: { name: 'CellComboboxTemplate', data: { options: property, selectedValue: selectedValue, optionsText: optionsText, readOnly: false } }" /&gt;
  {{/if}}
  </code></pre>
  
  <p>Next I bound the readonly property to the readonly attribute in the child template, but unfortunately this doesn't work. Is there another way to do this?</p>