mbest/knockout — Issue #9: make 'with' more lightweight
Author: mbest
Created: 2011-12-20 22:12:53+00:00
State: open

The 'with' binding currently uses the native template template engine, which adds a lot of overhead. The main purpose of the 'with' binding is to push a new binding context to the stack for child elements (doesn't affect any other bindings on the same element as 'with').

The current implementation also does an 'if' with the target of 'with', which I think is incorrect (doesn't match the way 'with' works in JS or in other languages). So although removing the templating code under with would remove the 'if' functionality, I thinks that it's better anyway.

'with' should still work in container-less bindings (), which would need to be modified to work with non-template bindings.