Trigger .trigger('contentUpdated')
on the element where dynamic content is injected.
$.ajax({
url: 'https://www.example.com',
method: 'POST',
data: {
id: '1'
},
success: function (data) {
$('.example-element').html(data)
.trigger('contentUpdated')
}
});
@timneutkens It doesn't seem to work with knockout templates inside data from
element.html(data)
.The component is initialized. But something like
<div data-bind="visible: myFunction()">
is not called in my case. Tried also with koif
comment statement.