O'Reilly logo

Mastering KnockoutJS by Timothy Moran

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Applying bindings

The binding application process takes place primarily in the bindingAttributeSyntax module, which defines the ko.bindingContext class as well as the ko.applyBindings method. The high-level overview looks like this:

  1. The ko.applyBindings method is called with the viewmodel.
  2. A binding context is constructed using the viewmodel.
  3. The binding provider is retrieved from ko.bindingProvider.instance.
  4. Knockout works with the DOM tree:
    • It is passed through the binding provider's node preprocessor (except the root node)
    • The binding handlers for the node are constructed using the binding provider
    • The binding handlers are sorted by ensuring that any bindings in their after property are loaded first
    • The binding handlers are iterated through, calling ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required