I have a viewmodel setup that is as follows:
<div id='stuff'>
<div id='i_need_this'>
<input type='checkbox' data-bind="checked: enabled" />
</div>
</div>
<script>
var vm = new vm();
ko.applyBindings(vm, $("#stuff").get(0));
var i_need_this_vm = new i_n_t();
ko.applyBindings(i_need_this_vm, $("#i_need_this").get(0));
</script>
I have one viewmodel that is bound to the parent div of "stuff" but I want the i_need_this viewmodel to be bound to the i_need_this div. When I apply this binding though I am getting an error that "Uncaught Error: Unable to parse bindings. Message: ReferenceError: enabled is not defined;" Is this related to how my viewmodels are arranged, and if so is there a way around it?
Thanks!