I am extending an observable called "obsRandom" inside "extend" which looks like this:
var options = {
extend: {
"{root}": function (self) {
self.obsRandom = ko.observable(true)
........
I have read about this article http://coderenaissance.github.io/knockout.viewmodel/ that explains the viewmodel plugin, but I still cannot think of a way to data-bind the created observable.
How can we do data-bind our html element
input type="radio" data-bind="checked: ???"
to this new extended observable?
I have tried data-bind="checked: $root.options.extend.obsRandom" but doesn't work.
obsRandomshould be at the top level of your viewmodel, so your binding would just be"checked: obsRandom"- Roy J