AdamPflug/Knockout.Programmatic — Issue #1: foreach binding
Author: bazjapan
Created: 2012-01-30 03:18:33+00:00
State: open

Hi Adam, thanks for putting this out. It's really useful.
I'm wondering whether you are still using this with knockout2.
I'm having some trouble using the foreach binding. Knockout gives me the following error:

parentBindingContext is undefined

testArray : ko.observableArray([{
name: "a"},
{
name: "b"},
{
name: "c"}])

Hello

$("ul[data-id=listtest]", context).databind({
foreach : vm_local.testArray
});

//error happening in this code
knockout-2.0.0.debug.js (line 2788)

ko.renderTemplateForEach = function (template, arrayOrObservableArray, options, targetNode, parentBindingContext) {
var createInnerBindingContext = function(arrayValue) {
return parentBindingContext['createChildContext'](ko.utils.unwrapObservable(arrayValue));
};

throws : parentBindingContext is undefined