Knockout Containerless Binding Example

In this blog, I will create a sample which demonstrates how we can avoid creating unnecessary div or other containers to use knockout bindings.

Let's take a look at the code first.

The general idea here is to use comment syntax to inform knockout that it needs to use inline binding. We don't need to use unnecessary divs to make this binding work. 
As we have seen in the previous examples of binding the syntax for binding if, with, templates and foreach remains the same.
Here's how the output looks: