knockout icon indicating copy to clipboard operation
knockout copied to clipboard

Load dynamic component without using Require.js dependency

Open alvarotrigo opened this issue 5 years ago • 1 comments
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()

    });

alvarotrigo avatar Jul 14 '20 17:07 alvarotrigo

Can you elaborate more on what you'd like to be able to do?

mbest avatar Jul 16 '20 02:07 mbest