Last active
March 10, 2023 02:17
-
-
Save LucasCalazans/0126da828e4475313fd375bdfc6ba633 to your computer and use it in GitHub Desktop.
Refresh bindings for a knockout component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#btn').on('click', () => { | |
$.get('https://app.magento.localhost/test/index/index').done(result => { | |
$('#container').replaceWith($(result).find('#container')); | |
$('body').trigger('contentUpdated'); | |
ko.cleanNode($('.column.main')[0]); | |
$('.column.main').applyBindings(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://magento.stackexchange.com/questions/258660/magento-2-how-to-bind-knockout-event-on-ajax-html-response/258687#258687