ko.widget is knockout plugin to build widgets
function HelloWorldWidget() {
ko.widget.extend(this, [new ViewModel(), View]);
}
var widget = new HelloWorldWidget();
widget.appendTo($("body"));
var widget = new HelloWorldWidget();
ko.applyBindings({helloWorld: widget});
<div data-bind="inject: helloWorld"></div>
function PanelWidget() {
ko.widget.extend(this, [new ViewModel(), View]);
this.exportMethods("show", "hide", "visible");
};