Skip to content

Instantly share code, notes, and snippets.

@rauhryan
Created December 9, 2010 17:58
Show Gist options
  • Save rauhryan/735063 to your computer and use it in GitHub Desktop.
Save rauhryan/735063 to your computer and use it in GitHub Desktop.
output of select box
<select>
<option> Select ... </option>
<option value='__ko.bindingHandlers.options.optionValueDomData__'>Hi</option>
</select>
<script type='text/javascript'>
var viewModel = function() {
this.options = [{ id: 1, value : 'Hi' }]
}
jQuery(function($) {
ko.applyBindings(viewModel);
});
</script>
<select data-bind="options: options, optionsCaption: ' Select ...', optionsText: 'value'" ></select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment