Bindings and Observables ( Silence ) Bindings and Observables are at the heart of how Knockout (Inaudible) work. So in this module, we'll take a deep look into how built-in bindings work and the different kinds of observables that you have at your disposal. But first, we'll take a look at how you deal with pushing and pulling data without using data binding and without using knockout. And then we'll show an example with knockout so we can see the value prop that it brings. Then we'll dive into observables, which we've already seen a few examples in Module One, how an observable field, basically, a property like first name can notify the screen and then come back and notify back to the object. And then sometimes you need to have computed observables. What computed observables are, it's like you have calculated fields or, in some cases, converters, where you can read and write values that may not exactly map one-to-one from a property in a source object to a target on the screen. So we'll explore how those work. Of course, sometimes you have properties that are observables, and sometimes you want to have arrays that are observables as well. So you might have an array where you want to be notified on the screen when an item has been added or removed or even replaced. We'll explore what you can do with those arrays, how they work with knockout and different functions that you can do upon them. And sometimes you want to be notified when an observable changes. So you can actually subscribe to the change event of an observable yourself and perform some custom action on those as well. So let's dive right into these fundamental concepts.
Templates, Control of Flow, and Containerless Bindings As you start developing applications in Knockout, you're going to find yourself wanting more than just simple built-in bindings. And there's couple other features that are really, really advantageous. And some of my favorite of these are handling templates, control of flow, and containerless bindings. In this module, we'll show you how to use all of those. First, we're going to start out with name templates, showing you how you can create templates that could be easily reused throughout the application just by calling their name. The more we get into control of flow and show how we can use things like foreach statements and if statements right inside of our bindings. We'll talk about how binding context work for you as well so you can dive into an object hierarchy such as your inside of a template and then the context for the data might be, let's say a person, and you want to go back up to the root context that might be one of two levels up. You can use combining context to change the context from person up one or two or other types of levels. This is similar to using the RelativeSource ancestor binding that's in XML technologies. Inline templates are also very handy because you can create a template that is right inline with your HTML structure using this control flow statements which is very handy as well. And for those times when you want to be able to change the templates you might rendering from one template to other dynamically, we're going to talk about dynamically choosing a template and show you how to do that through Knockout. And templates also have binding helpers which allow you to pass data in or handle things like "After I rendered, what do I do? " or "Before I remove an item, what do I do? " So I'll show you how you can use some of those binding helpers. And then one of my favorite features is containerless bindings which is new with Knockout 2. 0. 0, it allows you to create-- containerless bindings means you don't have to actually have div tags and spans just to create some kind of a binding structure, you can actually do it with containerless bindings which are basically HTML comments, and these really come in handy in a lot of situations. So by then end of this module, you should have a great understanding about templates and control flow and all the different kind of binding context can help you build really robust Knockout applications. ( Pause )