I have the following custom binding
ko.bindingHandlers.dialogFor = { init: function(el, valueAccessor) { $(el).dialog(); var val = valueAccessor(); if(ko.isObservable(val)) $(el).on('dialogclose', function(){ val(null) }); } }; This allows me to tag an html fragment with a dialogFor binding and open dialogs simply by setting observables.
Unfortunately, the value that gets passed in is always unwrapped so the if check never passes and resetting the observable on dialog close doesn't work.
How do I get the actual observable that was passed, not just the unwrapped value?