#Getting Started with Knockback.js

In essence, Knockback.js bridges the dynamic DOM bindings of Knockout.js with the models, computeds, and routers of Backbone.js. It also brings some other cool features like localization, default values, and nested view models!

If you are more of JavaScript developer than a CoffeeScript hipster, check out the JavaScript language toggle for the site (at the top right) on many pages with code and live examples.

#Tidbits

  • 'kb' and 'Knockback' can be used interchangeably

  • Knockback.js uses the following coding conventions: ClassName, functionName, property_name, 'constant string', "dynamic string", CONSTANT_NAME

#Classes vs Factory Functions You will soon notice that there are different capitalizations for things like kb.viewModel(model, options) and kb.ViewModel. The reason is that to reduce the need of using new and to be more familiar with Knockout, there are factory methods that create the underlying classes.

A factory function uses new to create a new instance:

Knockback.viewModel = (model, options) -> return new Knockback.ViewModel(model, options)
Knockback.viewModel = function(model, options) { return new Knockback.ViewModel(model, options); };

#Useful Resources

Before you start with Knockback.js, we recommend you first get acquainted with Backbone.js and Knockout.js by reviewing their websites (above) and you could also look at these resources:

For Knockback.js, also take a look at this comparison table between the libraries or this blog entry which provides a good introduction.

#Topics

You can find the various 'Getting Started' topics in the navigation bar above: