Book Image

Mastering KnockoutJS

By : Timothy Moran
Book Image

Mastering KnockoutJS

By: Timothy Moran

Overview of this book

Table of Contents (16 chapters)
Mastering KnockoutJS
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Calling ko.applyBindings once (per root)


I can't tell you how many times I've come across questions on Stack Overflow regarding problems that come from developers calling ko.applyBindings multiple times, thinking that it is responsible for syncing the DOM and the observable data. This is more of a warning than a best practice, but I would feel remiss if I left it out entirely. For any given root element in your HTML, you should have one call to ko.applyBindings at most.