O'Reilly logo

Getting Started with Knockout.js for .NET Developers by Andrey Akinshin

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

Binding context

Binding contexts are a hierarchical structure of special objects that help you make logical scopes for the control flow bindings. Each such binding (such as foreach, if, with, and so on) generates its own binding context in the hierarchy. You can think of contexts as a scoped wrapper of a ViewModel. For example, the root binding context refers to your main ViewModel. You can work with contexts with the help of special properties that are listed as follows. The best way to understand the binding context concept is to look at some examples. Let's do it.

  • $parent: This refers to the ViewModel of the parent binding context. For example, say you have the foreach binding to the book collection, but want to use the name of the library ...

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