Using knockout.js in our current project, we have already come to this question several times.
How can I make sure that some piece of Javascript code is executed only after all the bindings on the page have been applied to the knockout?
In my specific use case, I use if-bindings to evaluate some configuration options and decide whether elements should be displayed inside (= in the DOM) or not. Only after these grades ifhave been evaluated, do I need to count the number of DOM nodes within a specific element. Obviously, if I think too early that the bindings ifhave not yet removed these unwanted DOM nodes, so the calculation comes up with the wrong result.
source
share