I've just started looking at knockout components.
I am trying to do the following.
from the main module
var setup = {color:"pink"};
ko.components.register('headerbar', {require:"/headerbar"});
the component
define(["ko", "text!./headerbar.html"], function(ko, html) {
"use strict";
var vm = function(prms){
//use passed setup info here
};
return { viewModel: vm, template: html };
});
I hope to be able to do this, so I can pass in some set up details and not have to express them in each instance of the component via its params
This is what I ended up with.
calling code