I am trying to create new component in knockout:
ko.components.register("categories", {
viewModel: {
instance: MY_VIEW_MODEL
},
template: require('html-loader?interpolate!./components/categories.html')
});
and my HTML block inside of categories.html:
<div class="panel" data-bind="foreach: categories, afterRender: ${require('../effects.js').fadePanels()}"></div>
and inside of effect.js:
function fadePanels() {
$('.panel').velocity('fadeInPanels', {
stagger: 250,
})
}
plus webpack.config.js:
test: /\.html$/,
loader: 'html-loader',
options: {
interpolate: true
},
exclude: /node_modules/
but it's not working at all. Here is the output from browser (no errors in console):
Do you have any experience with this? Do you know how to correctly handle that?