Ok, I've tried both of these options before, but just wanted to see if
there was something better.
Also, just as a note, I'd seriously avoid doing init bindings with UI
elements in them.
For instance, I've seen something like this:
ko.bindingHandlers.dialog= {
init: function(element, valueAccessor) {
var options = valueAccessor() || {};
$(element).dialog(options);
}
Because dialog is stateful, if you are switching templates in and out
dynamically, init gets called multiple times in the same context and
causes some serious leaking. In fact, with dialog, if you switched
templates in and out dynamically, this would actually spawn a new
dialog every time you loaded the template.
I'm not 100% sure that slider has similar behavior, but I'm still wary
of this approach anyways.