In general, avoid using the CSS styles to hide DOM elements. If you use display:none on a div, the contained markup always remains in the DOM with its data-bind attributes applied, even if the div is not displayed and any changes to the view model will keep updating the children, which may result in performance degradation. Only use this approach if the visible condition changes frequently to avoid reconstructing the DOM for every change. In all other situations, use the ko-if binding if binding does not construct the DOM when the condition results to false. Whenever the condition results in true, this reconstructs child nodes and binds the view model.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices