Is it possible to check if a property of an observable has an element bound to it?
<div data-bind="visible: MyObject().property1">Property 1 has a value</div>
<div data-bind="text: MyObject().property1"></div>
</script>
var ViewModel = function()
{
this.MyObject = ko.observable({property1: "some text", property2: "some other text"});
}
var vm = new ViewModel();
ko.applyBindings(vm);
</script>
Is there any way to determine if any elements are bound to a property (i.e. MyObject().property1
) (and if so, which elements? (in this case an array of 2 divs)), and further, if there are no elements bound to a property (i.e. MyObject().property2
)