How to Run Javascript after KnockoutJS has rendered all elements in a page magento 2?

Magento uses knockout js at many places in the code. You can see Checkout page data render using knockout js in Magento 2. To custom requirement, You need to execute some javascript code after knockout js load completely.

If you are using require([“jquery”, “domReady!”], function($){} function or jQuery(window).load() function, Using this way mostly your custom javascript code execute before the knockout element render.

One Reply to “How to Run Javascript after KnockoutJS has rendered all elements in a page magento 2?”

  1. Great tip!
    Is there a way to add “afterRender” throw a widget script?
    I’d like to update a component in a widget script tag adding the “afterRender” config.
    Is it possible?

Leave a Reply