AndersMalmgren/Knockout.BindingConventions — pull request #3 by mbest (2013-08-20 02:24:39+00:00)
Title: Update for Knockout 3.0 support

As described in knockout/knockout#1075, this library is broken with Knockout 3.0 because it relies on an unsupported "feature" in Knockout. The supported way to add bindings after the initial `applyBindings` run is to call `ko.applyBindingsToNode`.

But Knockout 3.0 deprecates both `ko.applyBindingsToNode` and `.getBindings` in favor of `ko.applyBindingAccessorsToNode` and `.getBindingAccessors`. This pull request includes a migration from `getBindings` to `getBindingAccessors`, and support for deferred bindings using `ko.applyBindingAccessorsToNode`.

The `data` parameter to `.apply` is now `dataFn` to match the 3.0 method of setting up bindings.

I also removed the `viewModel` parameter to `apply` and `rules` because, with observable view model support in 3.0, it's best to always get the view model through `bindingContext.$data`.

This update is not compatible with Knockout 2.x, although it probably could be made backwards compatible with some simple changes.