Knockoutjs Docsから、私はこの文を理解していません:
テンプレートは既にこの要素に注入されていますが、まだバインドされていません。
ko.components.register('my-component', {
viewModel: {
createViewModel: function(params, componentInfo) {
// - 'params' is an object whose key/value pairs are the parameters
// passed from the component binding or custom element
// - 'componentInfo.element' is the element the component is being
// injected into. When createViewModel is called, the template has
// already been injected into this element, but isn't yet bound.
// Return the desired view model instance, e.g.:
return new MyViewModel(params);
}
},
template: ...
});