README.md

make amazingly dynamic applications by applying a small number of simple principles

leverage the wonderful work from both the Backbone and Knockout communities

(optional) simplify program control flow by configuring your application from your HTML Views (new!): think of it like Angular.js without memorizing all of the special purpose ng-{something} attributes. See the Inject Tutorial for live examples!

Core

Removes advanced features that can be included separately: localization, formatting, triggering, defaults, validation, and statistics. Stack provides Underscore.js + Backbone.js + Knockout.js + Knockback.js in a single file.

Why Write Knockback.js?

When I was evaluating client-side frameworks, I liked lots of the pieces, but wanted to "mix and match" the best features. I started with Backbone.js and really loved the Models and Collections, and used Brunch to get me up and running quickly.

After a while, I found the view coding too slow so I wrote Mixin.js to extract out reusable aspects of my views. When I was looking for my next productivity increase, an ex-work colleague suggested Sproutcore, but at the time, it wasn't yet micro-frameworky enough meaning I would need to learn something big and "to throw the baby out with the bathwater" as they say (it is hard to give up Backbone models and collections!). Then, I discovered Knockout and knew it was for me!

Knockout provided just the right building blocks for a layer between my templates and data. As I used it more, I built additional functionality like Backbone.ModelRefs for lazy model loading, localization helpers for truly dynamic views, and most recently, an easier way to sync collections and their model's view models.

So here it is...the refactored and shareable version of my Backbone bindings for Knockout: Knockback.js

Enjoy!

Kevin

An Example

The view model:

ContactViewModel =(model)->
kb.viewModel(model, {
name:'name'email: {key:'email', default:'your.name@yourplace.com'}
date: {key:'date', localizer: LongDateLocalizer}
}, this)
@# must return this or Coffeescript will return the last statement which is not what we want!