knockout
knockout copied to clipboard
Load dynamic component without using Require.js dependency
trafficstars
I would like to remove the require.js dependency from my project. Isn't there any simple way of dynamically load a component without using require?
At the moment I'm using the following:
ko.components.register(element, {
viewModel: { instance: demoViewModel },
template: { require: 'text!views/demo.html' },
});
requirejs.config({
paths: {
text: 'bower_components/text/text'
},
urlArgs: "v=" + new Date().valueOf()
});
Can you elaborate more on what you'd like to be able to do?