Q: KnockoutJS template ignores 'controlsDescendantBindings' I have a part of my template that I don't want to be rendered, so I have tried with "controlsDescendantBindings" as the documentation proposes.
I have done an example where the model contains two properties, "Parent" and "Child". Parent must be shown, but Child must be not rendered.
I am using the KO Programmatic plugin.
It works neat with normal bindings: http://jsfiddle.net/vtortola/QXJVb/
It works when using a template: http://jsfiddle.net/vtortola/uKLnm/3/
And it does not work when using KO programmatically: http://jsfiddle.net/vtortola/XGApK/
Does anybody know a workaround for this?
Thanks.

A: Two things.


*

*You were using knockout 2.0 and jQuery tmpl. These don't play well together. Knockout has its own template engine built in since 2.0. jQuery tmpl is deprecated, and I think it also is no longer under development by its creators. You should not use it.

*Your second fiddle didn't call ko.applyBindings, which is a necessary step. Your first one worked because you had that call.


Here is your fiddle, working with a template and a stop binding. Here is the fiddle using the jQuery method
Note
Knockout provides its own method for limiting binding to specific divs. KO Programmatic looks kind of... unnecessary. Here is the snippet from the documentation page:

Optionally, you can pass a second parameter to define which part of the document you want to search for data-bind attributes. For example, ko.applyBindings(myViewModel, document.getElementById('someElementId')). This restricts the activation to the element with ID someElementId and its descendants, which is useful if you want to have multiple view models and associate each with a different region of the page.

Update:
As promised, screenshot that these fiddles work as you describe.
the regular method:

the jQuery/KO programmatic method:

