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

Chapter 2. Extending Knockout with Custom Binding Handlers

Knockout's standard bindings are great. They solve most of the general problems you are likely to encounter when developing web apps. But there is always the need to provide something special, whether you are working on your own library or just trying to add a bit of style to your app. When that happens, you will want to provide that functionality through the same binding system you are using everywhere else. Luckily, Knockout makes extending this system easy. In this chapter, we will be looking at how to make our own binding handlers. We will be covering the following topics:

  • What a binding handler contains

  • Creating new binding handlers

  • Using custom binding handlers to integrate with third-party libraries

  • Managing binding contexts

  • Using the containerless control flow syntax with custom bindings

Creating custom binding handlers for new and more complex HTML interactions is a key to developing feature-rich applications. While the basics...